This was reported as a bug against Emacs 22 in Debian unstable.  If
you don't consider this a bug, just let me know, and I'll close it.

Briefly, the claim is that font-lock-global-modes doesn't work as
documented -- values of t and nil are treated identically.

(If possible, please maintain the CC to 475649-forwarded.)

Ivan Shmakov <[EMAIL PROTECTED]> writes:

> Package: emacs22
> Version: 22.1+1-3
>
>       C-h v font-lock-global-modes reads:
>
> *Modes for which Font Lock mode is automagically turned on.  Global
> Font Lock mode is controlled by the command `global-font-lock-mode'.
> If nil, means no modes have Font Lock mode automatically turned on.
> If t, all modes that support Font Lock mode have it automatically
> turned on.  If a list, it should be a list of `major-mode' symbol
> names for which Font Lock mode should be automatically turned on.
> The sense of the list is negated if it begins with `not'.  For
> example:
>  (c-mode c++-mode)
> means that Font Lock mode is turned on for buffers in C and C++
> modes only.
>
>       However, when set to any object which is not a list with car
>       equal to 'not, the turn-on-font-lock-if-enabled function
>       behaves as if it was set to t.  I. e., both of the following
>       are interpreted the same:
>
> (setq font-lock-global-modes t)
>
> (setq font-lock-global-modes nil)
>
>       Apparently, the following change fixes the problem:
>
> --- lisp/font-core.el.~1~     2008-04-12 13:55:21.772259215 +0700
> +++ lisp/font-core.el 2008-04-12 13:54:52.958924668 +0700
> @@ -282,8 +282,10 @@
>    :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)))
> +  (when (if (eq (car-safe font-lock-global-modes) 'not)
> +         (not (memq major-mode (cdr font-lock-global-modes)))
> +       (or (eq t font-lock-global-modes)
> +           (memq major-mode font-lock-global-modes)))
>      (let (inhibit-quit)
>        (turn-on-font-lock))))
>  
>
>
>

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to