]> code.delx.au - gnu-emacs/commitdiff
* lisp/format.el (format-annotate-function): Handle read-only text properties
authorGlenn Morris <rgm@gnu.org>
Sat, 27 Jul 2013 00:29:42 +0000 (20:29 -0400)
committerGlenn Morris <rgm@gnu.org>
Sat, 27 Jul 2013 00:29:42 +0000 (20:29 -0400)
in the source.

Fixes: debbugs:14887
lisp/ChangeLog
lisp/format.el

index 0c5b857d374f713a0ebab60ab8aff10b1d3a50ba..14af1cfbda9ffa5f3fc597f4eb39f858e973241c 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-27  Glenn Morris  <rgm@gnu.org>
+
+       * format.el (format-annotate-function):
+       Handle read-only text properties in the source.  (Bug#14887)
+
 2013-07-24  Glenn Morris  <rgm@gnu.org>
 
        * dired-x.el (dired-mark-extension): Convert comment to doc string.
index 221eaadcdd81e907102ae8d9701a01480fe903f7..fc8dcb97b013772d0926067487de1055dced1962 100644 (file)
@@ -225,10 +225,12 @@ For most purposes, consider using `format-encode-region' instead."
                (setq selective-display sel-disp)
                (set-buffer-multibyte multibyte)
                (setq buffer-file-coding-system coding-system))
-             (copy-to-buffer copy-buf from to)
-             (set-buffer copy-buf)
-             (format-insert-annotations write-region-annotations-so-far from)
-             (format-encode-run-method to-fn (point-min) (point-max) orig-buf)
+             (let ((inhibit-read-only t)) ; bug#14887
+               (copy-to-buffer copy-buf from to)
+               (set-buffer copy-buf)
+               (format-insert-annotations write-region-annotations-so-far from)
+               (format-encode-run-method to-fn (point-min) (point-max)
+                                         orig-buf))
               (when (buffer-live-p copy-buf)
                 (with-current-buffer copy-buf
                   ;; Set write-region-post-annotation-function to