emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error text-read-only in shell-command


From: Tassilo Horn
Subject: Error text-read-only in shell-command
Date: Wed, 12 Jan 2011 10:01:27 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Hi all,

I've just dired and opened acroread using & on a pdf file to fill out
some forms.  After closing that, I wanted to open another file with an
external app using &.  But then I got an text-read-only error.

I've tracked it down to the call to `erase-buffer' in `shell-command'.
That fails, because although buffer-read-only is set to nil explicitly,
parts of the output acroread produced in *Async Shell Command Output*
has the read-only text property set to 'fence (whatever that means).
(The linebreaks have that property...)

The following patch fixes the issue.  Ok to commit?

--8<---------------cut here---------------start------------->8---
=== modified file 'lisp/simple.el'
--- lisp/simple.el      2011-01-02 20:28:40 +0000
+++ lisp/simple.el      2011-01-12 08:53:08 +0000
@@ -2341,7 +2341,10 @@
                      (error "Shell command in progress")))
                (with-current-buffer buffer
                  (setq buffer-read-only nil)
-                 (erase-buffer)
+                 ;; Setting buffer-read-only to nil doesn't help for
+                 ;; characters with read-only text property.
+                 (let ((inhibit-read-only t))
+                   (erase-buffer))
                  (display-buffer buffer)
                  (setq default-directory directory)
                  (setq proc (start-process "Shell" buffer shell-file-name
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]