# HG changeset patch # User Stefan Monnier # Date 1181599031 0 # Node ID 4d83e9f9b01e791c0afa73775962433112436367 # Parent e70e9b06760f9f2cfd0ad55174cfd4343bed5e30 (font-lock-add-keywords): In case font-lock was only half-activated, forcefully activate it completely. diff -r e70e9b06760f -r 4d83e9f9b01e admin/FOR-RELEASE --- a/admin/FOR-RELEASE Mon Jun 11 15:46:12 2007 +0000 +++ b/admin/FOR-RELEASE Mon Jun 11 21:57:11 2007 +0000 @@ -36,32 +36,6 @@ * BUGS -** hi-lock-mode doesn't always turn on font-lock-mode-internal - -From: Alan Mackenzie -Subject: hi-lock-mode doesn't work with emacs -Q. -Message-ID: <20070607092651.GA1710@muc.de> - -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 ; 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 -r e70e9b06760f -r 4d83e9f9b01e lisp/ChangeLog --- a/lisp/ChangeLog Mon Jun 11 15:46:12 2007 +0000 +++ b/lisp/ChangeLog Mon Jun 11 21:57:11 2007 +0000 @@ -1,3 +1,8 @@ +2007-06-11 Stefan Monnier + + * font-lock.el (font-lock-add-keywords): In case font-lock was only + half-activated, forcefully activate it completely. + 2007-06-11 Richard Stallman * cus-edit.el (custom-variable-type): Doc fix. diff -r e70e9b06760f -r 4d83e9f9b01e lisp/font-lock.el --- a/lisp/font-lock.el Mon Jun 11 15:46:12 2007 +0000 +++ b/lisp/font-lock.el Mon Jun 11 21:57:11 2007 +0000 @@ -698,6 +698,14 @@ ;; 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.