# HG changeset patch # User Andreas Schwab # Date 1030814549 0 # Node ID 7c974d3849fae5878429d4c1229f9ac98b6c6566 # Parent 4defb27e6876861b9fa3887ee0c7c0f2186769c7 (font-lock-change-mode): Avoid changing buffer state in any way. diff -r 4defb27e6876 -r 7c974d3849fa lisp/font-core.el --- 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)))