diff options
author | Alan Mackenzie <acm@muc.de> | 2012-02-26 13:02:52 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2012-02-26 13:02:52 +0000 |
commit | 487915d7385aeef679d9a6f077f319540835da4c (patch) | |
tree | e0b0d93fcf491e6e9e506a54aaeba7a4b5f22a81 /lisp/font-core.el | |
parent | c2c792605f7ea40e5e9a02c1ee701bcc33db8bdf (diff) | |
download | emacs-487915d7385aeef679d9a6f077f319540835da4c.tar.gz |
Check there is a font-lock specification before initial fontification.
Diffstat (limited to 'lisp/font-core.el')
-rw-r--r-- | lisp/font-core.el | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lisp/font-core.el b/lisp/font-core.el index 9b655319bc9..4a88d973913 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -138,7 +138,7 @@ The above is the default behavior of `font-lock-mode'; you may specify your own function which is called when `font-lock-mode' is toggled via `font-lock-function'. " nil nil nil - :after-hook (if font-lock-mode (font-lock-initial-fontify)) + :after-hook (font-lock-initial-fontify) ;; Don't turn on Font Lock mode if we don't have a display (we're running a ;; batch job) or if the buffer is invisible (the name starts with a space). (when (or noninteractive (eq (aref (buffer-name) 0) ?\s)) @@ -192,13 +192,7 @@ this function onto `change-major-mode-hook'." ;; Only do hard work if the mode has specified stuff in ;; `font-lock-defaults'. - (when (or font-lock-defaults - (if (boundp 'font-lock-keywords) font-lock-keywords) - (and mode - (boundp 'font-lock-set-defaults) - font-lock-set-defaults - font-lock-major-mode - (not (eq font-lock-major-mode major-mode)))) + (when (font-lock-spec-present mode) (font-lock-mode-internal mode))) (defun turn-on-font-lock () |