aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/font-lock.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r--lisp/font-lock.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index c826a5f20c6..265cc4bf682 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -698,6 +698,14 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
698 ;; contain the new keywords. 698 ;; contain the new keywords.
699 (font-lock-update-removed-keyword-alist mode keywords how)) 699 (font-lock-update-removed-keyword-alist mode keywords how))
700 (t 700 (t
701 (when (and font-lock-mode
702 (not (or font-lock-keywords font-lock-defaults)))
703 ;; The major mode has not set any keywords, so when we enabled
704 ;; font-lock-mode it only enabled the font-core.el part, not the
705 ;; font-lock-mode-internal. Try again.
706 (font-lock-mode -1)
707 (set (make-local-variable 'font-lock-defaults) '(nil t))
708 (font-lock-mode 1))
701 ;; Otherwise set or add the keywords now. 709 ;; Otherwise set or add the keywords now.
702 ;; This is a no-op if it has been done already in this buffer 710 ;; This is a no-op if it has been done already in this buffer
703 ;; for the correct major mode. 711 ;; for the correct major mode.