unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 23783@debbugs.gnu.org
Subject: bug#23783: Emacs 25: Changing font-lock-maximum-decoration doesn't work.
Date: Sat, 18 Jun 2016 17:19:03 +0000	[thread overview]
Message-ID: <20160618171903.GB5796@acm.fritz.box> (raw)
In-Reply-To: <83ziqiakhx.fsf@gnu.org>

Hello, Eli.

On Sat, Jun 18, 2016 at 12:56:10PM +0300, Eli Zaretskii wrote:
> > Date: Fri, 17 Jun 2016 10:25:00 +0000
> > From: Alan Mackenzie <acm@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.

I haven't read them yet, but I will.  It is not user friendly to have to
set an option before visiting a file.  In this case, a natural use case
would be to want to reduce the decoration level after finding things
being too slow at the default level.

> > 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.

Thanks!

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

OK.  I'll think about trying to fix the code in the near future.

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2016-06-18 17:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 10:25 bug#23783: Emacs 25: Changing font-lock-maximum-decoration doesn't work Alan Mackenzie
2016-06-18  9:56 ` Eli Zaretskii
2016-06-18 17:19   ` Alan Mackenzie [this message]
2016-06-18 17:37     ` Eli Zaretskii
2016-06-18 20:03       ` bug#23783: Minor feature fixes and enhancements [Was: bug#23783: Emacs 25: Changing font-lock-maximum-decoration doesn't work.] Alan Mackenzie
2016-06-18 21:21         ` John Wiegley
2016-06-19  2:34         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160618171903.GB5796@acm.fritz.box \
    --to=acm@muc.de \
    --cc=23783@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).