From: Michael Albinus <michael.albinus@gmx.de>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Loris Bennett <loris.bennett@fu-berlin.de>,
emacs-orgmode <emacs-orgmode@gnu.org>,
Alexander Vorobiev <alexander.vorobiev@gmail.com>,
Johannes Rainer <johannes.rainer@i-med.ac.at>
Subject: Re: org mode R remote code evaluation
Date: Fri, 27 Sep 2013 13:39:50 +0200 [thread overview]
Message-ID: <87vc1mijcp.fsf@gmx.de> (raw)
In-Reply-To: <87mwn0u5sh.fsf@gmail.com> (Eric Schulte's message of "Wed, 25 Sep 2013 12:15:10 -0600")
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
Eric Schulte <schulte.eric@gmail.com> writes:
> I'd rather not hard-code the value of "/tmp/". Perhaps you could rework
> the patch so that it introduces a new customizable variable (including a
> documentation string) so that users can set the value for their system.
>
> Also, please package the patch with git format-patch.
Patch is appended.
> Thanks,
Best regards, Michael.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ob-core.el-org-babel-local-file-name-Simplify.patch --]
[-- Type: text/x-diff, Size: 2737 bytes --]
From 2b8db5486de75ec35c2c0d3e6063847cf582ace7 Mon Sep 17 00:00:00 2001
From: Michael Albinus <michael.albinus@gmx.de>
Date: Fri, 27 Sep 2013 13:34:03 +0200
Subject: [PATCH] * ob-core.el (org-babel-local-file-name): Simplify.
(org-babel-process-file-name): Apply `expand-file-name' first.
(org-babel-remote-temporary-directory): New defcustom. (org-babel-temp-file):
Use it.
---
lisp/ob-core.el | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 5a032a1..a7c227b 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2680,11 +2680,7 @@ Fixes a bug in `tramp-handle-call-process-region'."
(defun org-babel-local-file-name (file)
"Return the local name component of FILE."
- (if (file-remote-p file)
- (let (localname)
- (with-parsed-tramp-file-name file nil
- localname))
- file))
+ (or (file-remote-p file 'localname) file))
(defun org-babel-process-file-name (name &optional no-quote-p)
"Prepare NAME to be used in an external process.
@@ -2694,7 +2690,10 @@ remotely. The file name is then processed by `expand-file-name'.
Unless second argument NO-QUOTE-P is non-nil, the file name is
additionally processed by `shell-quote-argument'"
((lambda (f) (if no-quote-p f (shell-quote-argument f)))
- (expand-file-name (org-babel-local-file-name name))))
+ ;; We must apply `expand-file-name' on the whole filename. If we
+ ;; would apply it on the local filename only, undesired effects
+ ;; like prepending a drive letter on MS Windows could happen.
+ (org-babel-local-file-name (expand-file-name name))))
(defvar org-babel-temporary-directory)
(unless (or noninteractive (boundp 'org-babel-temporary-directory))
@@ -2707,6 +2706,11 @@ additionally processed by `shell-quote-argument'"
Used by `org-babel-temp-file'. This directory will be removed on
Emacs shutdown."))
+(defcustom org-babel-remote-temporary-directory "/tmp/"
+ "Directory to hold temporary files on remote hosts."
+ :group 'org-babel
+ :type 'string)
+
(defmacro org-babel-result-cond (result-params scalar-form &rest table-forms)
"Call the code to parse raw string results according to RESULT-PARAMS."
(declare (indent 1)
@@ -2736,7 +2740,8 @@ of `org-babel-temporary-directory'."
(if (file-remote-p default-directory)
(let ((prefix
(concat (file-remote-p default-directory)
- (expand-file-name prefix temporary-file-directory))))
+ (expand-file-name
+ prefix org-babel-remote-temporary-directory))))
(make-temp-file prefix nil suffix))
(let ((temporary-file-directory
(or (and (boundp 'org-babel-temporary-directory)
--
1.8.1.2
next prev parent reply other threads:[~2013-09-27 11:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 6:31 org mode R remote code evaluation Johannes Rainer
2013-08-29 8:25 ` Loris Bennett
2013-08-29 10:42 ` Johannes Rainer
2013-09-23 16:45 ` Alexander Vorobiev
2013-09-24 12:57 ` Michael Albinus
2013-09-24 13:21 ` Alexander Vorobiev
2013-09-24 13:25 ` Michael Albinus
[not found] ` <CAGOCFPUyTaQzVTSwjUOJBfwF8vUzyw=Gn43+bHs8Go8+RUU+nA@mail.gmail.com>
2013-09-24 18:40 ` Michael Albinus
2013-09-25 4:24 ` Alexander Vorobiev
2013-09-25 10:44 ` Michael Albinus
2013-09-25 18:15 ` Eric Schulte
2013-09-25 19:03 ` Michael Albinus
2013-09-25 20:36 ` Alexander Vorobiev
2013-09-26 8:11 ` Michael Albinus
[not found] ` <CAGOCFPXj2-3FruuD=K7=H+SQ308dzkH1P=qP0b17xQuoW9MkPQ@mail.gmail.com>
[not found] ` <87mwmzy16d.fsf@gmx.de>
2013-09-26 17:28 ` Alexander Vorobiev
2013-09-26 17:43 ` Michael Albinus
2013-09-27 11:39 ` Michael Albinus [this message]
2013-09-28 11:41 ` Eric Schulte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vc1mijcp.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=alexander.vorobiev@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=johannes.rainer@i-med.ac.at \
--cc=loris.bennett@fu-berlin.de \
--cc=schulte.eric@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).