GNU bug report logs - #23783
Emacs 25: Changing font-lock-maximum-decoration doesn't work.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Fri, 17 Jun 2016 10:32:02 UTC

Severity: minor

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#23783: closed (Emacs 25: Changing font-lock-maximum-decoration
 doesn't work.)
Date: Sat, 18 Jun 2016 09:56:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 18 Jun 2016 12:56:10 +0300
with message-id <83ziqiakhx.fsf <at> gnu.org>
and subject line Re: bug#23783: Emacs 25: Changing font-lock-maximum-decoration doesn't work.
has caused the debbugs.gnu.org bug report #23783,
regarding Emacs 25: Changing font-lock-maximum-decoration doesn't work.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
23783: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23783
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Alan Mackenzie <acm <at> muc.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs 25: Changing font-lock-maximum-decoration doesn't work.
Date: Fri, 17 Jun 2016 10:25:00 +0000
Hello, Emacs.

In GNU Emacs 25.0.94.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.7)
 of 2016-06-07 built on acm
Repository revision: 9d5ccebeba0506f7280662630f0ee85a52c8a327
Configured using:
 'configure --with-tiff=no --with-gif=no --with-gpm'

Do this:
1. emacs -Q
2. M-x customize-variable <CR> font-lock-maximum-decoration <CR>
   o - set the level to 1 (minimum decoration) and apply the new
     setting.
3. C-x C-f .../src/xdisp.c
4. Note that font locking is indeed at level 1.  Note, indeed, how fast
   scrolling works.  ;-)
5. M-x customize-variable <CR> font-lock-maximum-decoration <CR>
   o - set the level to t (maximum decoration) and apply.
6. (In the xdisp.c window) M-x font-lock-mode, twice.
7. Note that the font locking remains at level 1.

This last is surely a bug.  Enabling font locking in a buffer should use
the current valid setting of font-lock-maximum-decoration.

Discussion:
-----------

There are no instructions in the Emacs manual which tell you how to
change decoration levels.  It merely states on page "Font Lock Mode"
that "You can customize the variable `font-lock-maximum-decoration' to
alter the amount of fontification applied by Font Lock mode, for major
modes that support this feature.".  This doesn't then say what is to be
done after doing such customization, for it to take effect.

There is a non-interactive function `font-lock-refresh-defaults' which
works, but this function isn't called from anywhere in Emacs.

-- 
Alan Mackenzie (Nuremberg, Germany).


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 23783-done <at> debbugs.gnu.org
Subject: Re: bug#23783: Emacs 25: Changing font-lock-maximum-decoration doesn't
 work.
Date: Sat, 18 Jun 2016 12:56:10 +0300
> Date: Fri, 17 Jun 2016 10:25:00 +0000
> From: Alan Mackenzie <acm <at> muc.de>
> 
> 1. emacs -Q
> 2. M-x customize-variable <CR> font-lock-maximum-decoration <CR>
>    o - set the level to 1 (minimum decoration) and apply the new
>      setting.
> 3. C-x C-f .../src/xdisp.c
> 4. Note that font locking is indeed at level 1.  Note, indeed, how fast
>    scrolling works.  ;-)
> 5. M-x customize-variable <CR> font-lock-maximum-decoration <CR>
>    o - set the level to t (maximum decoration) and apply.
> 6. (In the xdisp.c window) M-x font-lock-mode, twice.
> 7. Note that the font locking remains at level 1.
> 
> This last is surely a bug.  Enabling font locking in a buffer should use
> the current valid setting of font-lock-maximum-decoration.

It's quite clear from the code that this is the intended behavior.
The comments for font-lock-set-defaults (the function and the
variable) and for font-lock-refresh-defaults are especially revealing.

> There are no instructions in the Emacs manual which tell you how to
> change decoration levels.  It merely states on page "Font Lock Mode"
> that "You can customize the variable `font-lock-maximum-decoration' to
> alter the amount of fontification applied by Font Lock mode, for major
> modes that support this feature.".  This doesn't then say what is to be
> done after doing such customization, for it to take effect.
> 
> There is a non-interactive function `font-lock-refresh-defaults' which
> works, but this function isn't called from anywhere in Emacs.

I have added to the Emacs manual explanation of how to make the
customization of font-lock-maximum-decoration effective in a file
buffer.  In a nutshell, you need to either customize before visiting
the file, or kill the buffer and revisit the file after the
customization.

I think this fixes this bug, so I'm closing it.

Thanks.


This bug report was last modified 8 years and 341 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.