emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Remove obsolete fast-lock and lazy-lock libraries


From: Jeff Norden
Subject: Re: [PATCH] Remove obsolete fast-lock and lazy-lock libraries
Date: Sat, 08 Aug 2020 23:04:42 -0500

> One thing to note is that I've kept the support for
> 'font-lock-support-mode' set to nil since Alan Mackenzie indicated
> that this could be useful for debugging purposes here:
>   https://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00748.html
> Perhaps it should be changed into a defvar, though. Or maybe it is no
> longer useful. But that could in any case be done separately, I think.

I discovered (setq font-lock-support-mode nil) just a few weeks ago, and
found it to be a helpful tool for debugging fontification code.  It
simplifies things by letting you temporarily take the jit-lock layer
entirely out of the picture.  Once things are working without jit, you
can then use jit-lock-debug-mode to further narrow down issues.

A variable name like font-lock-use-jit might be more clear, maybe with
font-lock-support-mode as an obsolete alias, which would now only have a
nil-or-non-nil effect.  Perhaps this would be good to do along with 
removing {fast,lazy}-lock.  If someone has an ancient .emacs that contains
  (setq font-lock-support-mode 'fast-lock-mode)
would the best thing be to just use jit-lock-mode instead?  If I'm reading
the patch correctly, it would make setting the support-mode to fast-lock
equivalent to setting it to nil.

It might make sense to also drop the defcustom status of the support-mode
variable (or its replacement), since jit-lock is the only non-nil option.
Things can still be pretty slow without jit, despite comments in the 2011 post
that is referenced above.  On my computer (a relatively current intel i5),
fontifying all of xdisp.c (1.1MB) takes about 8.3 sec with the default c-mode.
This could become a problem when font-lock-maximum-size goes away.
(I got this time by setting font-lock-support-mode to nil, opening
xdisp.c, which is now un-fontified b/c of its size, and then 'M-x benchmark'
followed by (font-lock-fontify-buffer)).

-Jeff 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]