aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2007-06-11 21:57:11 +0000
committerStefan Monnier <[email protected]>2007-06-11 21:57:11 +0000
commit72fa3278be1baf255a3027229e28d3574f17601e (patch)
tree234390daacde53806f3936078456d448f887f2e5
parent3a07a00bbf3ae87a87ae54a0336f574b67d45da9 (diff)
(font-lock-add-keywords): In case font-lock was only
half-activated, forcefully activate it completely.
-rw-r--r--admin/FOR-RELEASE26
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/font-lock.el8
3 files changed, 13 insertions, 26 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index fe226fc7d9..0f8bd0c442 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -36,32 +36,6 @@ to the hack introduced on 2005-07-01 to fix some other Cleartype problem.
* BUGS
-** hi-lock-mode doesn't always turn on font-lock-mode-internal
-
-From: Alan Mackenzie <[email protected]>
-Subject: hi-lock-mode doesn't work with emacs -Q.
-Message-ID: <[email protected]>
-
-Start emacs -Q. (Emacs 22.1, of course). Visit a new file with:
-
- C-x C-f foo.txt
-
-. Type this:
-
- This file is foo.txt.
-
-. Enable hi-lock-mode and make "foo" a highlightable pattern:
-
- M-x hi-lock-mode
- C-x w h foo<CR><CR> ; accept the default hi-yellow face.
-
-. This highlights the "foo" yellow, as expected. At the end of the
-line, type:
-
- foo
-
-. This new "foo" doesn't get highlighted. It should be.
-
* FIXES FOR EMACS 22.2
Here we list small fixes that arrived too late for Emacs 22.1, but
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f5b63f3757..41c902b9a8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-11 Stefan Monnier <[email protected]>
+
+ * font-lock.el (font-lock-add-keywords): In case font-lock was only
+ half-activated, forcefully activate it completely.
+
2007-06-11 Richard Stallman <[email protected]>
* cus-edit.el (custom-variable-type): Doc fix.
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index c826a5f20c..265cc4bf68 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',
;; contain the new keywords.
(font-lock-update-removed-keyword-alist mode keywords how))
(t
+ (when (and font-lock-mode
+ (not (or font-lock-keywords font-lock-defaults)))
+ ;; The major mode has not set any keywords, so when we enabled
+ ;; font-lock-mode it only enabled the font-core.el part, not the
+ ;; font-lock-mode-internal. Try again.
+ (font-lock-mode -1)
+ (set (make-local-variable 'font-lock-defaults) '(nil t))
+ (font-lock-mode 1))
;; Otherwise set or add the keywords now.
;; This is a no-op if it has been done already in this buffer
;; for the correct major mode.