Bastien <b...@altern.org> 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.

>From a39b35c3967ac7c95e3442434a3ca44cba54fca5 Mon Sep 17 00:00:00 2001
From: Michael Albinus <michael.albi...@gmx.de>
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

Reply via email to