Achim Gratz <strom...@nexgo.de> writes: >> + (let ((input-file (org-babel-temp-file "input-")) >> + (error-file (if error-buffer (org-babel-temp-file "scor-") nil)) >> + (shell-file-name >> + (if (file-executable-p >> + (concat (file-remote-p default-directory) shell-file-name)) >> + shell-file-name >> + "/bin/sh")) > > The hard-coded /bin/sh breaks testing with NT-Emacs and using Cygwin as > the backend because of the different path conventions in both > environments. This is a hack, but it works when setting SHELL=dash, > note that there are no path components in there and even if your test > would fail: NTEmacs knows nothing about Cygwin's path. Can you please > arrange that shell-file-name is used without alteration when the > execution is local? Even for remote execution hardcoding /bin/sh seems > a bit heavy-handed to me…
What about this: --8<---------------cut here---------------start------------->8--- --- 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 --8<---------------cut here---------------end--------------->8--- The use of "/bin/sh" as fallback should be OK. In the local case, the first cond clause shall be selected (otherwise there is something really wrong). And for remote execution, "/bin/sh" should exist execept in case of remote MS Windows or Android devices. Once you want run shells from org there, we could even tweak this :-) > Regards, > Achim. Best regards, Michael.