changeset 47176:7c974d3849fa

(font-lock-change-mode): Avoid changing buffer state in any way.
author Andreas Schwab <schwab@suse.de>
date Sat, 31 Aug 2002 17:22:29 +0000
parents 4defb27e6876
children 13c19667a7a0
files lisp/font-core.el
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/font-core.el	Sat Aug 31 10:17:09 2002 +0000
+++ b/lisp/font-core.el	Sat Aug 31 17:22:29 2002 +0000
@@ -218,11 +218,20 @@
 ;; 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)))