diff options
author | Colin Walters <walters@gnu.org> | 2002-06-09 00:41:11 +0000 |
---|---|---|
committer | Colin Walters <walters@gnu.org> | 2002-06-09 00:41:11 +0000 |
commit | c32aa1a58037864ada514a1286d7bb58a5ac0d8f (patch) | |
tree | 7e1faa02f9686d4461a5f9466240d7aded64f469 /lisp/font-core.el | |
parent | e9476ca8e2d271bc2f27cc0f81899b5c464becba (diff) | |
download | emacs-c32aa1a58037864ada514a1286d7bb58a5ac0d8f.tar.gz |
(font-lock-default-function): If `font-lock-core-only' is non-nil,
don't use big font-lock machinery.
Diffstat (limited to 'lisp/font-core.el')
-rw-r--r-- | lisp/font-core.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/font-core.el b/lisp/font-core.el index 08d2eb07d97..69e899f31e5 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -225,7 +225,8 @@ your own function which is called when `font-lock-mode' is toggled via (push (list 'face 'font-lock-face) char-property-alias-alist))) ;; Only do hard work if the mode has specified stuff in ;; `font-lock-defaults'. - (when font-lock-defaults + (when (and font-lock-defaults + (not font-lock-core-only)) (add-hook 'after-change-functions 'font-lock-after-change-function t t) (font-lock-turn-on-thing-lock) ;; Fontify the buffer if we have to. @@ -247,7 +248,8 @@ your own function which is called when `font-lock-mode' is toggled via (setcdr elt (remq 'font-lock-face (cdr elt))) (when (null (cdr elt)) (setq char-property-alias-alist (delq elt char-property-alias-alist))))) - (when font-lock-defaults + (when (and font-lock-defaults + (not font-lock-core-only)) (remove-hook 'after-change-functions 'font-lock-after-change-function t) (font-lock-unfontify-buffer) (font-lock-turn-off-thing-lock)))) @@ -269,11 +271,13 @@ Sets various variables using `font-lock-defaults' (or, if nil, using (make-local-variable 'font-lock-multiline) (let ((defaults (or font-lock-defaults (assq major-mode font-lock-defaults-alist)))) + ;; Variable alist? + (dolist (x (nthcdr 5 defaults)) + (set (make-local-variable (car x)) (cdr x))) (when (and defaults ;; Detect if this is a simple mode, which doesn't use ;; any syntactic fontification functions. - (not (cdr (assq 'font-lock-core-only - (nthcdr 5 defaults))))) + (not font-lock-core-only)) (require 'font-lock) (font-lock-set-defaults-1))))) |