# HG changeset patch # User Richard M. Stallman # Date 1031676228 0 # Node ID 78178028d9877b04eb7ba71eb6a85c180c1ed2be # Parent c863060047d68d3a7f5b386f90305c4f18455c5b (font-lock-defontify): New function. diff -r c863060047d6 -r 78178028d987 lisp/font-core.el --- a/lisp/font-core.el Tue Sep 10 16:40:10 2002 +0000 +++ b/lisp/font-core.el Tue Sep 10 16:43:48 2002 +0000 @@ -220,6 +220,18 @@ (defun font-lock-change-mode () (font-lock-mode -1)) +(defun font-lock-defontify () + "Clear out all `font-lock-face' properties in current buffer. +A major mode that uses `font-lock-face' properties should put +this function onto `change-major-mode-hook'." + (let ((modp (buffer-modified-p)) + (inhibit-read-only t)) + (save-restriction + (widen) + (remove-list-of-text-properties (point-min) (point-max) + '(font-lock-face))) + (set-buffer-modified-p modp))) + (defun font-lock-default-function (mode) ;; Turn on Font Lock mode. (when mode