summaryrefslogtreecommitdiff
path: root/lisp/font-core.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2012-02-26 13:02:52 +0000
committerAlan Mackenzie <acm@muc.de>2012-02-26 13:02:52 +0000
commit487915d7385aeef679d9a6f077f319540835da4c (patch)
treee0b0d93fcf491e6e9e506a54aaeba7a4b5f22a81 /lisp/font-core.el
parentc2c792605f7ea40e5e9a02c1ee701bcc33db8bdf (diff)
downloademacs-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.el10
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 ()