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


View this message in rfc822 format

From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: 18096 <at> debbugs.gnu.org
Subject: bug#18096: 24.3.92; async shell command and a busy buffer leads to error
Date: Thu, 24 Jul 2014 14:13:06 +0200
Running the following and answering "yes" to the prompt leads to an error:

(let ((b (get-buffer-create "Some command")))
  (shell-command "sleep 1 &" b)
  (shell-command ":&" b))

Debugger entered--Lisp error: (wrong-type-argument stringp #<buffer Some command>)
  generate-new-buffer-name(#<buffer Some command>)
  generate-new-buffer(#<buffer Some command>)
  (setq buffer (generate-new-buffer (or output-buffer "*Async Shell Command*")))
  [hand-edited]
  shell-command(":&" #<buffer Some command>)

I suggest the following in order to have a better error message :

--- 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")))

-- 
Nico.




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.