aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2002-08-31 17:22:46 +0000
committerAndreas Schwab2002-08-31 17:22:46 +0000
commit523d3bf425269ce2d727eb05e1fec4ab85d9c187 (patch)
tree07a1cfaa6c2a544599b50ca6ed7e4382a11a7854
parent97acc803a93ee97c503dfd197173d787bdeffe80 (diff)
downloademacs-523d3bf425269ce2d727eb05e1fec4ab85d9c187.tar.gz
emacs-523d3bf425269ce2d727eb05e1fec4ab85d9c187.zip
(font-lock-change-mode): Avoid changing buffer state in any way.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/font-core.el13
2 files changed, 16 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bf7a4bceea5..218de660f07 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12002-08-31 Andreas Schwab <schwab@suse.de>
2
3 * font-core.el (font-lock-change-mode): Avoid changing buffer
4 state in any way.
5
12002-08-30 Edward M. Reingold <reingold@emr.cs.iit.edu> 62002-08-30 Edward M. Reingold <reingold@emr.cs.iit.edu>
2 7
3 * calendar/diary-lib.el (diary-mail-entries): Don't overwrite 8 * calendar/diary-lib.el (diary-mail-entries): Don't overwrite
diff --git a/lisp/font-core.el b/lisp/font-core.el
index b26a86de2dc..e394be7dba2 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -218,11 +218,20 @@ your own function which is called when `font-lock-mode' is toggled via
218;; Get rid of fontification for the old major mode. 218;; Get rid of fontification for the old major mode.
219;; We do this when changing major modes. 219;; We do this when changing major modes.
220(defun font-lock-change-mode () 220(defun font-lock-change-mode ()
221 (let ((inhibit-read-only t)) 221 (let ((inhibit-read-only t)
222 (inhibit-point-motion-hooks t)
223 (inhibit-modification-hooks t)
224 (deactivate-mark nil)
225 (buffer-file-name nil)
226 (buffer-file-truename nil)
227 (buffer-undo-list t)
228 (modified (buffer-modified-p)))
222 (save-restriction 229 (save-restriction
223 (widen) 230 (widen)
224 (remove-list-of-text-properties 231 (remove-list-of-text-properties
225 (point-min) (point-max) '(font-lock-face)))) 232 (point-min) (point-max) '(font-lock-face)))
233 (unless modified
234 (restore-buffer-modified-p nil)))
226 (when font-lock-defaults 235 (when font-lock-defaults
227 (font-lock-unfontify-buffer))) 236 (font-lock-unfontify-buffer)))
228 237