From: Richard M. Stallman Date: Tue, 10 Sep 2002 16:43:48 +0000 (+0000) Subject: (font-lock-defontify): New function. X-Git-Tag: ttn-vms-21-2-B4~13265 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=67c9f58d7ecca6ac959201066cea60c167603d51;p=emacs.git (font-lock-defontify): New function. --- diff --git a/lisp/font-core.el b/lisp/font-core.el index 39d8daad1ec..0554d657497 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -220,6 +220,18 @@ your own function which is called when `font-lock-mode' is toggled via (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