218 |
;; Get rid of fontification for the old major mode. |
;; Get rid of fontification for the old major mode. |
219 |
;; We do this when changing major modes. |
;; We do this when changing major modes. |
220 |
(defun font-lock-change-mode () |
(defun font-lock-change-mode () |
221 |
(let ((inhibit-read-only t)) |
(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))) |
229 |
(save-restriction |
(save-restriction |
230 |
(widen) |
(widen) |
231 |
(remove-list-of-text-properties |
(remove-list-of-text-properties |
232 |
(point-min) (point-max) '(font-lock-face)))) |
(point-min) (point-max) '(font-lock-face))) |
233 |
|
(unless modified |
234 |
|
(restore-buffer-modified-p nil))) |
235 |
(when font-lock-defaults |
(when font-lock-defaults |
236 |
(font-lock-unfontify-buffer))) |
(font-lock-unfontify-buffer))) |
237 |
|
|