all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug#475649: font-lock-global-modes isn't interpreted correctly
       [not found] <m263unmufg.fsf@cherry.siamics.int>
@ 2008-07-24  4:23 ` Rob Browning
  0 siblings, 0 replies; only message in thread
From: Rob Browning @ 2008-07-24  4:23 UTC (permalink / raw
  To: bug-gnu-emacs; +Cc: 475649-forwarded, 475649, Ivan Shmakov


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 <ivan@theory.asu.ru> 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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-24  4:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <m263unmufg.fsf@cherry.siamics.int>
2008-07-24  4:23 ` Bug#475649: font-lock-global-modes isn't interpreted correctly Rob Browning

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.