From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Albinus Subject: Re: [BUG] remote execution in heterogeneous environment Date: Wed, 09 Jan 2013 14:05:20 +0100 Message-ID: <87vcb65wxb.fsf@gmx.de> References: <6D36E0F9-01D1-4F95-9FAA-B2B2CA10E57E@gmail.com> <87623zaj4j.fsf@gmx.de> <87hang279z.fsf@gmx.de> <87ip79q6x6.fsf_-_@Rainer.invalid> <87ip78gjfc.fsf@gmx.de> <87wqvmzs7m.fsf@gmx.de> <87y5g260fn.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsvLd-0006Nz-B3 for emacs-orgmode@gnu.org; Wed, 09 Jan 2013 08:05:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsvLY-0004Wd-FG for emacs-orgmode@gnu.org; Wed, 09 Jan 2013 08:05:37 -0500 Received: from mout.gmx.net ([212.227.17.21]:64254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsvLY-0004WL-5p for emacs-orgmode@gnu.org; Wed, 09 Jan 2013 08:05:32 -0500 Received: from mailout-de.gmx.net ([10.1.76.29]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MSXbW-1TRKM21TrY-00RWGu for ; Wed, 09 Jan 2013 14:05:30 +0100 In-Reply-To: <87y5g260fn.fsf@bzg.ath.cx> (Bastien's message of "Wed, 09 Jan 2013 12:49:32 +0100") 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: Bastien Cc: Achim Gratz , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Bastien writes: > Hi Michael, Hi Bastien, > Please send me your public key so that I can give your write access. > Otherwise can you just resent the patch as a git patch with a commit > message have an Emacs-ready ChangeLog entry? I don't believe I need permanent write access. Patch appended. > Thanks! Best regards, Michael. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ob-eval.el-org-babel-shell-command-on-region-Use.patch >From a39b35c3967ac7c95e3442434a3ca44cba54fca5 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 9 Jan 2013 13:48:30 +0100 Subject: [PATCH] * ob-eval.el (org-babel-shell-command-on-region): Use `executable-find' for local `shell-file-name' --- lisp/ob-eval.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ob-eval.el b/lisp/ob-eval.el index 8764920..8018111 100644 --- a/lisp/ob-eval.el +++ b/lisp/ob-eval.el @@ -137,11 +137,17 @@ specifies the value of ERROR-BUFFER." t))) (let ((input-file (org-babel-temp-file "input-")) (error-file (if error-buffer (org-babel-temp-file "scor-") nil)) + ;; Unfortunately, `executable-find' does not support file name + ;; handlers. Therefore, we could use it in the local case + ;; only. (shell-file-name - (if (file-executable-p - (concat (file-remote-p default-directory) shell-file-name)) - shell-file-name - "/bin/sh")) + (cond ((and (not (file-remote-p default-directory)) + (executable-find shell-file-name)) + shell-file-name) + ((file-executable-p + (concat (file-remote-p default-directory) shell-file-name)) + shell-file-name) + ("/bin/sh"))) exit-status) ;; There is an error in `process-file' when `error-file' exists. ;; This is fixed in Emacs trunk as of 2012-12-21; let's use this -- 1.7.10.4 --=-=-=--