GNU bug report logs - #18096
24.3.92; async shell command and a busy buffer leads to error

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Thu, 24 Jul 2014 12:12:02 UTC

Severity: normal

Found in version 24.3.92

Fixed in version 24.5.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 18096 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: 18096 <at> debbugs.gnu.org
Subject: Re: bug#18096: 24.3.92;
 async shell command and a busy buffer leads to error
Date: Mon, 28 Jul 2014 02:53:00 +0300
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -2904,7 +2904,8 @@ the use of a shell (with its need to quote arguments)."
>  		      (error "Shell command in progress")))
>  		   ((eq async-shell-command-buffer 'confirm-new-buffer)
>  		    ;; 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? ")
> +		    (if (and (stringp output-buffer)
> +                             (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*")))
>  		      (error "Shell command in progress")))

This will ignore the user customization in `async-shell-command-buffer'
if the user want it to ask a question whether to create a new buffer.
More tolerating would be trying to get a new buffer name even when
the given argument is a buffer:

=== modified file 'lisp/simple.el'
--- lisp/simple.el	2014-07-08 08:27:45 +0000
+++ lisp/simple.el	2014-07-27 23:44:20 +0000
@@ -2986,12 +2986,14 @@ (defun shell-command (command &optional
 		    ;; 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? ")






This bug report was last modified 10 years and 195 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.