aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2007-06-11 21:57:11 +0000
committerStefan Monnier2007-06-11 21:57:11 +0000
commit72fa3278be1baf255a3027229e28d3574f17601e (patch)
tree234390daacde53806f3936078456d448f887f2e5 /lisp
parent3a07a00bbf3ae87a87ae54a0336f574b67d45da9 (diff)
downloademacs-72fa3278be1baf255a3027229e28d3574f17601e.tar.gz
emacs-72fa3278be1baf255a3027229e28d3574f17601e.zip
(font-lock-add-keywords): In case font-lock was only
half-activated, forcefully activate it completely.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/font-lock.el8
2 files changed, 13 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f5b63f37570..41c902b9a86 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * font-lock.el (font-lock-add-keywords): In case font-lock was only
4 half-activated, forcefully activate it completely.
5
12007-06-11 Richard Stallman <rms@gnu.org> 62007-06-11 Richard Stallman <rms@gnu.org>
2 7
3 * cus-edit.el (custom-variable-type): Doc fix. 8 * cus-edit.el (custom-variable-type): Doc fix.
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.