diff options
| author | Andreas Schwab | 2002-08-31 17:22:46 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2002-08-31 17:22:46 +0000 |
| commit | 523d3bf425269ce2d727eb05e1fec4ab85d9c187 (patch) | |
| tree | 07a1cfaa6c2a544599b50ca6ed7e4382a11a7854 | |
| parent | 97acc803a93ee97c503dfd197173d787bdeffe80 (diff) | |
| download | emacs-523d3bf425269ce2d727eb05e1fec4ab85d9c187.tar.gz emacs-523d3bf425269ce2d727eb05e1fec4ab85d9c187.zip | |
(font-lock-change-mode): Avoid changing buffer state in any way.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/font-core.el | 13 |
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 @@ | |||
| 1 | 2002-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 | |||
| 1 | 2002-08-30 Edward M. Reingold <reingold@emr.cs.iit.edu> | 6 | 2002-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 | ||