]> git.eshelyaron.com Git - emacs.git/commitdiff
(font-lock-change-mode): Avoid changing buffer state in any way.
authorAndreas Schwab <schwab@suse.de>
Sat, 31 Aug 2002 17:22:46 +0000 (17:22 +0000)
committerAndreas Schwab <schwab@suse.de>
Sat, 31 Aug 2002 17:22:46 +0000 (17:22 +0000)
lisp/ChangeLog
lisp/font-core.el

index bf7a4bceea5506cdefd9aa9d522c73f14b86bd68..218de660f07e7edf843a77b1a949db78e9229166 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-31  Andreas Schwab  <schwab@suse.de>
+
+       * font-core.el (font-lock-change-mode): Avoid changing buffer
+       state in any way.
+
 2002-08-30  Edward M. Reingold  <reingold@emr.cs.iit.edu>
 
        * calendar/diary-lib.el (diary-mail-entries): Don't overwrite
index b26a86de2dcf79eea300be3d46dc5adea3497142..e394be7dba2ce439de6f4a4f0c7084cacdda7965 100644 (file)
@@ -218,11 +218,20 @@ your own function which is called when `font-lock-mode' is toggled via
 ;; Get rid of fontification for the old major mode.
 ;; We do this when changing major modes.
 (defun font-lock-change-mode ()
-  (let ((inhibit-read-only t))
+  (let ((inhibit-read-only t)
+       (inhibit-point-motion-hooks t)
+       (inhibit-modification-hooks t)
+       (deactivate-mark nil)
+       (buffer-file-name nil)
+       (buffer-file-truename nil)
+       (buffer-undo-list t)
+       (modified (buffer-modified-p)))
     (save-restriction
       (widen)
       (remove-list-of-text-properties
-       (point-min) (point-max) '(font-lock-face))))
+       (point-min) (point-max) '(font-lock-face)))
+    (unless modified
+      (restore-buffer-modified-p nil)))
   (when font-lock-defaults
     (font-lock-unfontify-buffer)))