From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eNcpBLKx2GAXHgEAgWs5BA (envelope-from ) for ; Sun, 27 Jun 2021 19:13:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4HdxO7Gx2GDIKAAAB5/wlQ (envelope-from ) for ; Sun, 27 Jun 2021 17:13:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8AB2426FD0 for ; Sun, 27 Jun 2021 19:13:20 +0200 (CEST) Received: from localhost ([::1]:47704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxYLN-0007IK-Ue for larch@yhetil.org; Sun, 27 Jun 2021 13:13:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxYL0-0007I0-Da for emacs-orgmode@gnu.org; Sun, 27 Jun 2021 13:12:54 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:46871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lxYKy-00046b-6u for emacs-orgmode@gnu.org; Sun, 27 Jun 2021 13:12:54 -0400 Received: by mail-pg1-x52c.google.com with SMTP id w15so8656364pgk.13 for ; Sun, 27 Jun 2021 10:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=y7gdKbexjr1wvI8AVk2yyMQMj74GpUcucyRwKAbjewk=; b=ZYFQxUcB8rsXcBhIoD//2Wt02tPQ/dqEaf8qVzbPY8XjZOzpVsC3i2YizQAme2HfKQ qFKwDUGBTIi3dGOhHuo9rY+f9xTNRcyGBLLEh/XtWIWlfvODr01tyCkgZ3nWbId+ovw+ 8iFRQ4nsXM13fM4SAqghVmn4OYpuB20lJ0nTPkkyC2sCCALOK2YLisDIxPeUVUDiCr5l lthKMJaZuJoKeB31wmu9bzi8l1i6g0rG3v48rlS3BAN80+YnLfwvD208JUIRdCQ/h/Z0 V0ig1Oo743lqgsOI74md87jvdDkTvK3ZvJmhh4Y82SztFeVpCi700yvfFe7FGuw/yjnN Tm3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=y7gdKbexjr1wvI8AVk2yyMQMj74GpUcucyRwKAbjewk=; b=QBsIUNvBDfqKKMEhbLomCYoGjIbg/YMHvE9WXQpNlkWA+fETc+FfnW/XfCNUlD/nxm pn6ABZLvFfsnjlxR4IqHaNFl9rgOY8yzhrPIBjjgNG6EfpsEHuJsbXnOf4Z+TwgU8Gnx COJUYSuXtD61b+ST+6Ln07zuUly1uNB47bGLJLk/xHjVZebSLRheejsYuqIvID2CKh0y YOdZXIGm4O0I/wPv5Z4ngBJEO9+AVT/mWqqjq+5KZAQnCEkaXtvqnWBSQ46F3H9YUfYo /gr8unSZ47X1SrjZRccn/4kwgIsdriY6A8hFeGZvqZFl/zKC+T5+2LQiPGaFqI+iuNQX +hKA== X-Gm-Message-State: AOAM533P/2cFaEQvCgZyKpnWUxkHhi2ixbO/BuLk3zCCren3IwnmdsIL WHdAmzvmb4d4YbNewZvtLpU= X-Google-Smtp-Source: ABdhPJxKJjWipCbqKGqGV/ysuu/Szb/nOcCvijcAE7IcCSlsLVw1iVllo2uvqeUOKTCGslWT2yh3LQ== X-Received: by 2002:a63:1324:: with SMTP id i36mr19542154pgl.8.1624813970116; Sun, 27 Jun 2021 10:12:50 -0700 (PDT) Received: from localhost ([198.27.182.161]) by smtp.gmail.com with ESMTPSA id v21sm16761285pju.47.2021.06.27.10.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jun 2021 10:12:49 -0700 (PDT) From: Jack Kamm To: Colin Baxter , Jeremie Juste Subject: Re: [PATCH] ob-R output file with graphics parameter In-Reply-To: <87pmwbty75.fsf@yandex.com> References: <8735t8nqlf.fsf@gmail.com> <87pmwbty75.fsf@yandex.com> Date: Sun, 27 Jun 2021 10:12:48 -0700 Message-ID: <871r8n1ban.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=jackkamm@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Berry, Charles" , Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624814000; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=y7gdKbexjr1wvI8AVk2yyMQMj74GpUcucyRwKAbjewk=; b=OY7IGHfUuXvLCA7gu6E39j8ln6SBA3fQdIMcIXvIdx9l6Bh6Y3+3JpnyejrzpgUUotraMG 8ZsxYzuKdgvQvPc4EZHyFpHAiWYdHr2MB4DQa6PHUOLknBaFhFtif+gCT8bjb01utsgle3 OFDAPx+ibwjrhDvXMVzYpIq1amwxaottS53p4VHkymUDDhCfaJDPebH+n52MCF/iwJZSee 3iKIYEALSqnzbkxUxjSrloCVXdBo91Q61w3sDMheebPGsJ+ff/A1zDNhYwiBoLCypgnF9u BvbNZjVrcoHa9yJw/qNDJzC6AzZkCuod2cy0tANG81SG+qxjtGcl1WtfnSyn6Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624814000; a=rsa-sha256; cv=none; b=k2W4QDeEbt9KYjGM+o5KPJ4R65W+rE74IAmg1LRl96haWB9GUiEJE0U0BHkPBL5cnVRATl BTbKpDShEAfNV+k7r8ZLCmrbHBliHa68A09gtDV/ZgERR6iC+c295/70ur3oisEiKVu6n2 tNFn1wqu6BtrAs8hpz4+iQv2pYzI0Mr8kANJ1T9R5Xq5u01sBu2IY66uWSXXWutvoFS1CY CQpZ/rww/4PMKwOkrgLL1Gjba2WINU/hpmhNjnS2zjTiZQfVTWyC4Q7c/B0JAM1nzBCLaN Wh2oiW55ASTp48VLMGOFnOF0/oj3ShxNaGjjx4/NNquVWh2yF2SIL0NbrJprEg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=ZYFQxUcB; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: 0.17 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=ZYFQxUcB; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 8AB2426FD0 X-Spam-Score: 0.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: LWo9XdCY3leo Hi all, > I obviously missing something. The above works for me without the > patch. Unfortunately, I can't trace back the thread in order to > understand the context. I think this is a followup from this mail: https://orgmode.org/list/87zgxc42qg.fsf@gmail.com/ wherein Jeremie states: > The current patch have been tested for remote connections as well and > AFAIK, nothing breaks. > > But I'm afraid that the graphical output is broken and has long been > even before the path. The test for graphical output is compromised and > does not do the right test. I will suggest new ones. So I think it's to do with graphical outputs in remote R sessions. However, I tested Jeremie's example on latest org master and it also worked fine for me, also on remote sessions. Jeremie, could you clarify the issue this fixes? > +(defun org-babel-output-link-path:R (params) > + "format org-link to file from PARAMS" > + > + (format "[[file:%s]]" (concat (cdr (assq :dir params)) > + "/" > + (cdr (assq :file params))))) Rather than concat, I think it is better to use expand-file-name, and also call file-name-as-directory on the directory component. Stylistically, I don't think there should be a blank line between the docstring and the code. The docstring should also start with a capital letter and end with a period. > + (setq out-file-path (concat > + (replace-regexp-in-string "/ssh:.*?:" "" (cdr (assq :dir params))) > + "/" > + out-file)) Use org-babel-process-file-name instead of replace-regexp-in-string to get the local path of the file. > - Remove second the need for a second file parameter This would indeed be nice. The requirement for a second file parameter was added in Org 9.3 to support the use case in this thread: https://orgmode.org/list/3ac2f42a-8ff2-1464-fa36-451e2ef0eacd@pressure.to/ But this syntax is annoyingly verbose for ob-R users, and also broke lots of ob-R examples prior to Org 9.3. A simple fix might be to have the "graphics" flag implicitly add the "file" flag as well. But we would need to first check that this doesn't break other use cases. > Subject: [PATCH 1/4] ob-R.el: Remove redundant argument to function I think it would be better to squash these changes into a single commit.