# HG changeset patch # User Richard M. Stallman # Date 1192814747 0 # Node ID 1cafaf44a9b94b7b1220fdde70a13c2fecf10f28 # Parent 6047442a3de94b03d9364038dbb3e44be5cd1be5 (turn-on-font-lock-if-desired): Renamed from `turn-on-font-lock-if-enabled'. Fully obey `font-lock-global-modes'. diff -r 6047442a3de9 -r 1cafaf44a9b9 lisp/font-core.el --- a/lisp/font-core.el Fri Oct 19 17:24:03 2007 +0000 +++ b/lisp/font-core.el Fri Oct 19 17:25:47 2007 +0000 @@ -234,7 +234,7 @@ ;; hook is run, the major mode is in the process of being changed and we do not ;; know what the final major mode will be. So, `font-lock-change-major-mode' ;; only (a) notes the name of the current buffer, and (b) adds our function -;; `turn-on-font-lock-if-enabled' to the hook variables +;; `turn-on-font-lock-if-desired' to the hook variables ;; `after-change-major-mode-hook' and `post-command-hook' (for modes ;; that do not yet run `after-change-major-mode-hook'). By the time ;; the functions on the first of these hooks to be run are run, the new major @@ -281,14 +281,17 @@ (repeat :inline t (symbol :tag "mode")))) :group 'font-lock) -(defun turn-on-font-lock-if-enabled () - (unless (and (eq (car-safe font-lock-global-modes) 'not) - (memq major-mode (cdr font-lock-global-modes))) +(defun turn-on-font-lock-if-desired () + (when (cond ((eq font-lock-global-modes t) + t) + ((eq (car-safe font-lock-global-modes) 'not) + (not (memq major-mode (cdr font-lock-global-modes)))) + (t (memq major-mode (cdr font-lock-global-modes)))) (let (inhibit-quit) (turn-on-font-lock)))) (define-globalized-minor-mode global-font-lock-mode - font-lock-mode turn-on-font-lock-if-enabled + font-lock-mode turn-on-font-lock-if-desired :extra-args (dummy) :initialize 'custom-initialize-safe-default :init-value (not (or noninteractive emacs-basic-display))