From 50f8cd9617d28c0d06103abd1bbbabcb27a9ef94 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Thu, 13 Jan 2011 19:58:28 +0100 Subject: [PATCH] * simple.el (shell-command): Don't error out if shell command buffer contains text with non-nil read-only property when erasing the buffer. --- lisp/ChangeLog | 6 ++++++ lisp/simple.el | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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 -- 2.39.5