From: Andreas Schwab Date: Sat, 31 Aug 2002 17:22:46 +0000 (+0000) Subject: (font-lock-change-mode): Avoid changing buffer state in any way. X-Git-Tag: ttn-vms-21-2-B4~13443 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=523d3bf425269ce2d727eb05e1fec4ab85d9c187;p=emacs.git (font-lock-change-mode): Avoid changing buffer state in any way. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bf7a4bceea5..218de660f07 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2002-08-31 Andreas Schwab + + * font-core.el (font-lock-change-mode): Avoid changing buffer + state in any way. + 2002-08-30 Edward M. Reingold * 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 ;; 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)))