]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/simple.el (shell-command): Use buffer-name when output-buffer is a buffer.
authorJuri Linkov <juri@jurta.org>
Sat, 8 Nov 2014 23:52:59 +0000 (01:52 +0200)
committerJuri Linkov <juri@jurta.org>
Sat, 8 Nov 2014 23:52:59 +0000 (01:52 +0200)
Fixes: debbugs:18096
lisp/ChangeLog
lisp/simple.el

index e2bf6bdeeae91a2653240e19dac94dacdef064c2..0aa7f04fecc1419d5196ce60ced9617b3a54679c 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-08  Juri Linkov  <juri@jurta.org>
+
+       * simple.el (shell-command): Use buffer-name when output-buffer is
+       a buffer.  (Bug#18096)
+
 2014-11-08  Juri Linkov  <juri@jurta.org>
 
        * minibuffer.el (minibuffer-completion-help): Compare this-command
index 08374c4ed65a43100f0756d5f1e58d6536ac8c17..203ea514e15996a0574be6e727a068ee03a7cd50 100644 (file)
@@ -3077,12 +3077,14 @@ the use of a shell (with its need to quote arguments)."
                    ;; If will create a new buffer, query first.
                    (if (yes-or-no-p "A command is running in the default buffer.  Use a new buffer? ")
                        (setq buffer (generate-new-buffer
-                                     (or output-buffer "*Async Shell Command*")))
+                                     (or (and (bufferp output-buffer) (buffer-name output-buffer))
+                                         output-buffer "*Async Shell Command*")))
                      (error "Shell command in progress")))
                   ((eq async-shell-command-buffer 'new-buffer)
                    ;; It will create a new buffer.
                    (setq buffer (generate-new-buffer
-                                 (or output-buffer "*Async Shell Command*"))))
+                                 (or (and (bufferp output-buffer) (buffer-name output-buffer))
+                                     output-buffer "*Async Shell Command*"))))
                   ((eq async-shell-command-buffer 'confirm-rename-buffer)
                    ;; If will rename the buffer, query first.
                    (if (yes-or-no-p "A command is running in the default buffer.  Rename it? ")