aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTino Calancha2020-01-23 10:56:02 +0100
committerTino Calancha2020-01-23 10:56:02 +0100
commite1deafd39d9ef32cfa54c0be498f26857bf49c25 (patch)
treea9f34ebee3b36f4d58724f8c51164168e94b4ff9
parentd15f2d4cbcd203d04737d56ee77676e25db6745a (diff)
downloademacs-e1deafd39d9ef32cfa54c0be498f26857bf49c25.tar.gz
emacs-e1deafd39d9ef32cfa54c0be498f26857bf49c25.zip
Backport: Fix bug 39218
* lisp/simple.el (shell-command): Ensure a shell command ending with `&' is run asynchronously.
-rw-r--r--lisp/simple.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 3546bef600d..73aea415c77 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3640,10 +3640,11 @@ impose the use of a shell (with its need to quote arguments)."
3640 (if handler 3640 (if handler
3641 (funcall handler 'shell-command command output-buffer error-buffer) 3641 (funcall handler 'shell-command command output-buffer error-buffer)
3642 (if (and output-buffer 3642 (if (and output-buffer
3643 (not (string-match "[ \t]*&[ \t]*\\'" command))
3643 (or (eq output-buffer (current-buffer)) 3644 (or (eq output-buffer (current-buffer))
3644 (and (stringp output-buffer) (eq (get-buffer output-buffer) (current-buffer))) 3645 (and (stringp output-buffer) (eq (get-buffer output-buffer) (current-buffer)))
3645 (not (or (bufferp output-buffer) (stringp output-buffer))))) ; Bug#39067 3646 (not (or (bufferp output-buffer) (stringp output-buffer))))) ; Bug#39067
3646 ;; Output goes in current buffer. 3647 ;; Synchronous command with output in current buffer.
3647 (let ((error-file 3648 (let ((error-file
3648 (and error-buffer 3649 (and error-buffer
3649 (make-temp-file 3650 (make-temp-file