From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suhail Shergill Subject: [PATCH] bugfix: fix `org-babel-execute-src-block' on remote hosts Date: Sat, 23 Mar 2013 23:52:07 +0000 Message-ID: <874ng1znbs.fsf@chaos.shergill.su> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJYES-0002lq-66 for emacs-orgmode@gnu.org; Sat, 23 Mar 2013 19:52:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJYEQ-0007nD-N9 for emacs-orgmode@gnu.org; Sat, 23 Mar 2013 19:52:16 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:57251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJYEQ-0007n3-CX for emacs-orgmode@gnu.org; Sat, 23 Mar 2013 19:52:14 -0400 Received: by mail-pb0-f45.google.com with SMTP id ro8so3609745pbb.18 for ; Sat, 23 Mar 2013 16:52:13 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org mode --=-=-= Content-Type: text/plain see attached patch. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-bugfix-fix-org-babel-execute-src-block-on-remote-hos.patch Content-Description: [PATCH] bugfix: fix `org-babel-execute-src-block' on remote hosts >From 7037a45f3504a8d95019bd2b496a919081e85331 Mon Sep 17 00:00:00 2001 From: Suhail Shergill Date: Sat, 23 Mar 2013 19:26:31 -0400 Subject: [PATCH] bugfix: fix `org-babel-execute-src-block' on remote hosts * lisp/ob.el (org-babel-temp-file): For remote hosts, modify the prefix and leave `temporary-file-directory' unchanged. The reason setting `temporary-file-directory' doesn't work here is because `make-temp-file' recursively calls itself (indirectly). Modifying `temporary-file-directly', affects the recursive calls as well, which results in a "No such file file or directory" error. The fix is to leave `temporary-file-directory' unaltered, for remote hosts, and instead modifying the 'prefix' argument to `make-temp-file' appropriately. TINYCHANGE --- lisp/ob.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index 7245714..1493355 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -2547,14 +2547,17 @@ Emacs shutdown.")) Passes PREFIX and SUFFIX directly to `make-temp-file' with the value of `temporary-file-directory' temporarily set to the value of `org-babel-temporary-directory'." - (let ((temporary-file-directory - (if (file-remote-p default-directory) - (concat (file-remote-p default-directory) "/tmp") + (if (file-remote-p default-directory) + (let ((prefix + (concat (file-remote-p default-directory) + (expand-file-name prefix temporary-file-directory)))) + (make-temp-file prefix nil suffix)) + (let ((temporary-file-directory (or (and (boundp 'org-babel-temporary-directory) (file-exists-p org-babel-temporary-directory) org-babel-temporary-directory) - temporary-file-directory)))) - (make-temp-file prefix nil suffix))) + temporary-file-directory))) + (make-temp-file prefix nil suffix)))) (defun org-babel-remove-temporary-directory () "Remove `org-babel-temporary-directory' on Emacs shutdown." -- 1.7.10.4 --=-=-= Content-Type: text/plain -- Suhail --=-=-=--