[Top][All Lists]

[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: Sun, 09 Aug 2020 16:34:43 -0500

Alan Mackenzie writes:
> This doesn't make sense, I think.  font-lock-support-mode is a function,
> and if a user has this set to a non-existent function, the correct
> response is surely to tell her with an error message, rather than
> executing a different function.
> The only reason anybody nowadays would set f-l-s-m to 'fast-lock-mode
> would be for debugging.  Let's not make that debugging any more
> difficult than it already is.

Stefan Monnier writes:
> IMNSHO, that variable should not be a defcustom any more and we
> shouldn't encourage users to touch it.  IOW we should mark it obsolete.
> We could OTOH add a new command to enter a form of
> `font-lock-debug-mode` which could disable the use of jit-lock (but not
> necessarily in exactly the same way as setting `font-lock-support-mode`
> would, tho it would probably be the most obvious immediate choice in the
> short term).

I guess my suggestion was to change f-l-s-m to a boolean flag in order
to make debugging *easier*.  My own experience, as someone previously
unfamiliar with the font-lock code, was that it took me a while to
discover that setting f-l-s-m to nil is the way to use font-lock
directly, without jit-lock "support".  Neither setting the jit-lock-mode
variable nor calling (jit-lock-mode nil) does this.  The latter will
turn off jit-lock, but doesn't tell font-lock to install its default
change functions.

I was also thinking that treating any non-nil value by using jit-Lock
would provide better backward compatibility.  I later realized that this
is actually a moot point.  The only way that setting f-l-s-m to
'fast-lock-mode will currently work is to also (require 'fast-lock), and
that is going to crash-and-burn once fast-lock-mode.el is gone.

Personally, I like Stefan M's suggestion of creating a new function or
variable and marking f-l-s-m as obsolete, but Eli's point that this
could be disruptive to people who are currently using f-l-s-m for
debugging is also well taken.  Anything that makes it clear how to
disable Jit Lock while still using Font Lock seem like an improvement
to me.


reply via email to

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