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

From: Sebastian Tennant <[email-masked]>
Date: Thu, 22 Jan 2009 14:00:26 +0000

Quoth Sebastian Tennant <[email-masked]>:
> 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.

Actually, this updated patch (attached) is what's required to fix the
problem here.

It explicitly puts the buffer in comint-mode.  (My last patch neglected
to do this).

Sebastian

--- /usr/share/emacs/22.2/lisp/simple.el~	2009-01-21 15:12:12.502915265 +0000
+++ /usr/share/emacs/22.2/lisp/simple.el	2009-01-22 13:22:17.352984134 +0000
@@ -1889,13 +1889,14 @@
 		      (error "Shell command in progress")))
 		(with-current-buffer buffer
 		  (setq buffer-read-only nil)
-		  (erase-buffer)
+		  (comint-mode) (erase-buffer)
 		  (display-buffer buffer)
 		  (setq default-directory directory)
-		  (setq proc (start-process "Shell" buffer shell-file-name
-					    shell-command-switch command))
+		  (setq proc (get-buffer-process
+			      (make-comint-in-buffer
+			       "Shell" buffer shell-file-name nil
+			       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

-- 
Emacs' AlsaPlayer - Music Without Jolts
Lightweight, full-featured and mindful of your idyllic happiness.
http://home.gna.org/eap