From: Tassilo Horn Date: Thu, 13 Jan 2011 18:58:28 +0000 (+0100) Subject: * simple.el (shell-command): Don't error out if shell command X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~1322^2~235^2~6 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=50f8cd9617d28c0d06103abd1bbbabcb27a9ef94;p=emacs.git * simple.el (shell-command): Don't error out if shell command buffer contains text with non-nil read-only property when erasing the buffer. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eafb096f499..df39fb29cd7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-01-13 Tassilo Horn + + * 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 * ido.el (ido-may-cache-directory): Move "too-big" check later. diff --git a/lisp/simple.el b/lisp/simple.el index 57ef84882d0..684d98df18e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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