# HG changeset patch # User Tassilo Horn # Date 1294945108 -3600 # Node ID 86a21f19b9e662f9f8469b692b87c92c03db3658 # Parent cf323f3bfe7f4560920b941d6d8b23a270ebe961 * 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 -r cf323f3bfe7f -r 86a21f19b9e6 lisp/ChangeLog --- a/lisp/ChangeLog Thu Jan 13 17:26:40 2011 +0100 +++ b/lisp/ChangeLog Thu Jan 13 19:58:28 2011 +0100 @@ -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 -r cf323f3bfe7f -r 86a21f19b9e6 lisp/simple.el --- a/lisp/simple.el Thu Jan 13 17:26:40 2011 +0100 +++ b/lisp/simple.el Thu Jan 13 19:58:28 2011 +0100 @@ -2341,7 +2341,11 @@ (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