]> git.eshelyaron.com Git - emacs.git/commitdiff
* simple.el (shell-command): Don't error out if shell command
authorTassilo Horn <tassilo@member.fsf.org>
Thu, 13 Jan 2011 18:58:28 +0000 (19:58 +0100)
committerTassilo Horn <tassilo@member.fsf.org>
Thu, 13 Jan 2011 18:58:28 +0000 (19:58 +0100)
buffer contains text with non-nil read-only property when erasing
the buffer.

lisp/ChangeLog
lisp/simple.el

index eafb096f499327be17789a66b4ad833c09008636..df39fb29cd75801d463612023610152fe9bb45e3 100644 (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.
index 57ef84882d0acfd2c2826fcaa703aac0a2d23a74..684d98df18e07e8ad83cc225c85820c1274ae029 100644 (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