aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-10-19 17:27:58 +0000
committerRichard M. Stallman2007-10-19 17:27:58 +0000
commit35a46c5c555809907b547e28eab845895e315b39 (patch)
tree9d5efcf2252bf9639a92555f3a09bd88cb7391d0
parent97862da1efc6310c5f9e0af95340efc0ab41d232 (diff)
downloademacs-35a46c5c555809907b547e28eab845895e315b39.tar.gz
emacs-35a46c5c555809907b547e28eab845895e315b39.zip
(turn-on-font-lock-if-desired):
Renamed from `turn-on-font-lock-if-enabled'. Fully obey `font-lock-global-modes'.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/font-core.el13
2 files changed, 14 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5fd75965a61..cba2388afd9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12007-10-19 Richard Stallman <rms@gnu.org>
2
3 * font-core.el (turn-on-font-lock-if-desired):
4 Renamed from `turn-on-font-lock-if-enabled'.
5 Fully obey `font-lock-global-modes'.
6
12007-10-19 Stefan Monnier <monnier@iro.umontreal.ca> 72007-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * diff-mode.el (diff-fine-highlight-preproc): Stick to minimal changes 9 * diff-mode.el (diff-fine-highlight-preproc): Stick to minimal changes
diff --git a/lisp/font-core.el b/lisp/font-core.el
index 7d7a65e83cc..b97550d2693 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -234,7 +234,7 @@ this function onto `change-major-mode-hook'."
234;; hook is run, the major mode is in the process of being changed and we do not 234;; hook is run, the major mode is in the process of being changed and we do not
235;; know what the final major mode will be. So, `font-lock-change-major-mode' 235;; know what the final major mode will be. So, `font-lock-change-major-mode'
236;; only (a) notes the name of the current buffer, and (b) adds our function 236;; only (a) notes the name of the current buffer, and (b) adds our function
237;; `turn-on-font-lock-if-enabled' to the hook variables 237;; `turn-on-font-lock-if-desired' to the hook variables
238;; `after-change-major-mode-hook' and `post-command-hook' (for modes 238;; `after-change-major-mode-hook' and `post-command-hook' (for modes
239;; that do not yet run `after-change-major-mode-hook'). By the time 239;; that do not yet run `after-change-major-mode-hook'). By the time
240;; the functions on the first of these hooks to be run are run, the new major 240;; the functions on the first of these hooks to be run are run, the new major
@@ -281,14 +281,17 @@ means that Font Lock mode is turned on for buffers in C and C++ modes only."
281 (repeat :inline t (symbol :tag "mode")))) 281 (repeat :inline t (symbol :tag "mode"))))
282 :group 'font-lock) 282 :group 'font-lock)
283 283
284(defun turn-on-font-lock-if-enabled () 284(defun turn-on-font-lock-if-desired ()
285 (unless (and (eq (car-safe font-lock-global-modes) 'not) 285 (when (cond ((eq font-lock-global-modes t)
286 (memq major-mode (cdr font-lock-global-modes))) 286 t)
287 ((eq (car-safe font-lock-global-modes) 'not)
288 (not (memq major-mode (cdr font-lock-global-modes))))
289 (t (memq major-mode (cdr font-lock-global-modes))))
287 (let (inhibit-quit) 290 (let (inhibit-quit)
288 (turn-on-font-lock)))) 291 (turn-on-font-lock))))
289 292
290(define-globalized-minor-mode global-font-lock-mode 293(define-globalized-minor-mode global-font-lock-mode
291 font-lock-mode turn-on-font-lock-if-enabled 294 font-lock-mode turn-on-font-lock-if-desired
292 :extra-args (dummy) 295 :extra-args (dummy)
293 :initialize 'custom-initialize-safe-default 296 :initialize 'custom-initialize-safe-default
294 :init-value (not (or noninteractive emacs-basic-display)) 297 :init-value (not (or noninteractive emacs-basic-display))