Subject: Bug in simple.el (Emacs version 22.2.1)

From: Sebastian Tennant <[email-masked]>
Date: Tue, 20 Jan 2009 20:10:58 +0000

Hello all,

Asynchronous commands called via shell-command, for example:

 (shell-command "apt-get update &")

fill the buffer *Async Shell Command Output* with Ctrl-Ms, which I'm
sure is not what's intended.

My patch (attached) fixes this by using make-comint-in-buffer, rather
than start-process, to call the asynchronous process.

HTH,

Sebastian

--- /usr/share/emacs/22.2/lisp/simple-patched.el	2009-01-20 19:51:29.528333079 +0000
+++ /usr/share/emacs/22.2/lisp/simple.el	2008-03-11 01:57:32.000000000 +0000
@@ -1892,11 +1892,10 @@
 		  (erase-buffer)
 		  (display-buffer buffer)
 		  (setq default-directory directory)
-		  (setq proc (get-buffer-process
-			      (make-comint-in-buffer
-			       "Shell" buffer shell-file-name nil
-			       shell-command-switch command)))
+		  (setq proc (start-process "Shell" buffer shell-file-name
+					    shell-command-switch command))
 		  (setq mode-line-process '(":%s"))
+		  (require 'shell) (shell-mode)
 		  (set-process-sentinel proc 'shell-command-sentinel)
 		  ))
 	    (shell-command-on-region (point) (point) command