summaryrefslogtreecommitdiff
path: root/lisp/textmodes/enriched.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-07-02 23:47:44 +0000
committerRichard M. Stallman <rms@gnu.org>2004-07-02 23:47:44 +0000
commit30f0bc330f0470ba6b03f3f5c7913c081dc7e74e (patch)
tree1dc5134b167b1ec99a6ddd361f2690de3e3241c5 /lisp/textmodes/enriched.el
parent83f411a2d2e259b3f3d26b3a627cf268b83b6946 (diff)
downloademacs-30f0bc330f0470ba6b03f3f5c7913c081dc7e74e.tar.gz
emacs-30f0bc330f0470ba6b03f3f5c7913c081dc7e74e.tar.bz2
emacs-30f0bc330f0470ba6b03f3f5c7913c081dc7e74e.zip
(enriched-encode): Bind inhibit-read-only.
Diffstat (limited to 'lisp/textmodes/enriched.el')
-rw-r--r--lisp/textmodes/enriched.el55
1 files changed, 28 insertions, 27 deletions
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
index 05eaef06ce6..531fe7d95df 100644
--- a/lisp/textmodes/enriched.el
+++ b/lisp/textmodes/enriched.el
@@ -282,33 +282,34 @@ the region, and the START and END of each region."
;;;###autoload
(defun enriched-encode (from to orig-buf)
(if enriched-verbose (message "Enriched: encoding document..."))
- (save-restriction
- (narrow-to-region from to)
- (delete-to-left-margin)
- (unjustify-region)
- (goto-char from)
- (format-replace-strings '(("<" . "<<")))
- (format-insert-annotations
- (format-annotate-region from (point-max) enriched-translations
- 'enriched-make-annotation enriched-ignore))
- (goto-char from)
- (insert (if (stringp enriched-initial-annotation)
- enriched-initial-annotation
- (save-excursion
- ;; Eval this in the buffer we are annotating. This
- ;; fixes a bug which was saving incorrect File-Width
- ;; information, since we were looking at local
- ;; variables in the wrong buffer.
- (if orig-buf (set-buffer orig-buf))
- (funcall enriched-initial-annotation))))
- (enriched-map-property-regions 'hard
- (lambda (v b e)
- (if (and v (= ?\n (char-after b)))
- (progn (goto-char b) (insert "\n"))))
- (point) nil)
- (if enriched-verbose (message nil))
- ;; Return new end.
- (point-max)))
+ (let ((inhibit-read-only t))
+ (save-restriction
+ (narrow-to-region from to)
+ (delete-to-left-margin)
+ (unjustify-region)
+ (goto-char from)
+ (format-replace-strings '(("<" . "<<")))
+ (format-insert-annotations
+ (format-annotate-region from (point-max) enriched-translations
+ 'enriched-make-annotation enriched-ignore))
+ (goto-char from)
+ (insert (if (stringp enriched-initial-annotation)
+ enriched-initial-annotation
+ (save-excursion
+ ;; Eval this in the buffer we are annotating. This
+ ;; fixes a bug which was saving incorrect File-Width
+ ;; information, since we were looking at local
+ ;; variables in the wrong buffer.
+ (if orig-buf (set-buffer orig-buf))
+ (funcall enriched-initial-annotation))))
+ (enriched-map-property-regions 'hard
+ (lambda (v b e)
+ (if (and v (= ?\n (char-after b)))
+ (progn (goto-char b) (insert "\n"))))
+ (point) nil)
+ (if enriched-verbose (message nil))
+ ;; Return new end.
+ (point-max))))
(defun enriched-make-annotation (internal-ann positive)
"Format an annotation INTERNAL-ANN.