From: Juri Linkov Date: Sat, 8 Nov 2014 23:52:59 +0000 (+0200) Subject: * lisp/simple.el (shell-command): Use buffer-name when output-buffer is a buffer. X-Git-Tag: emacs-25.0.90~2635^2~527 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6f443e47ac2ac9f8b44834efc6af4c9eb6ac226f;p=emacs.git * lisp/simple.el (shell-command): Use buffer-name when output-buffer is a buffer. Fixes: debbugs:18096 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e2bf6bdeeae..0aa7f04fecc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-11-08 Juri Linkov + + * simple.el (shell-command): Use buffer-name when output-buffer is + a buffer. (Bug#18096) + 2014-11-08 Juri Linkov * minibuffer.el (minibuffer-completion-help): Compare this-command diff --git a/lisp/simple.el b/lisp/simple.el index 08374c4ed65..203ea514e15 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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? ")