* simple.el (shell-command): Don't error out if shell command

buffer contains text with non-nil read-only property when erasing
the buffer.
This commit is contained in:
Tassilo Horn 2011-01-13 19:58:28 +01:00
parent 821f936d1c
commit 50f8cd9617
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2011-01-13 Tassilo Horn <tassilo@member.fsf.org>
* simple.el (shell-command): Don't error out if shell command
buffer contains text with non-nil read-only property when erasing
the buffer.
2011-01-13 Kim F. Storm <storm@cua.dk>
* ido.el (ido-may-cache-directory): Move "too-big" check later.

View file

@ -2341,7 +2341,11 @@ the use of a shell (with its need to quote arguments)."
(error "Shell command in progress")))
(with-current-buffer buffer
(setq buffer-read-only nil)
(erase-buffer)
;; Setting buffer-read-only to nil doesn't suffice
;; if some text has a non-nil read-only property,
;; which comint sometimes adds for prompts.
(let ((inhibit-read-only t))
(erase-buffer))
(display-buffer buffer)
(setq default-directory directory)
(setq proc (start-process "Shell" buffer shell-file-name