emacs-devel
[Top][All Lists]
Advanced

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

Re: Signal `quit' in a `font-lock-fontify-region-function'


From: Paul Pogonyshev
Subject: Re: Signal `quit' in a `font-lock-fontify-region-function'
Date: Tue, 28 May 2019 20:14:11 +0200

> Yes but: there's the obvious question of "how many C-g are
> necessary", as well as making sure this doesn't misfire just because the
> user hits C-g several times for some other reason.
>
> IOW, to do this, we'd need to make sure that Emacs was busy font-locking
> this one buffer during all this time, or something like that.

I certainly didn't mean one C-g. More like three presses within one
second and all during font-lock. Still could result in false positives, but
I believe an occasional unwanted broken fontlocking is better than
outright hung Emacs.

Could also be customizable as everything else.

I think a larger (apparent) problem is to let user know what's going on.
Naively issued messages would get overridden with "Quit" in the echo
area, because the natural response (at least mine) in such situation is
to mash C-g continuosly, not do it accurately and watch if there is any
change. And those "excessive" C-g would result in "Quit" message.
This is also part of the reason I haven't continued with implementing
this just for my mode, but rather feel it would be better as a general
Emacs feature.

> Also, I get the impression that we'd want this kind of behavior for more
> than just font-lock.

Yeah, I have encountered similar problems with timers due to some recent
bug. I mean, the bug has been fixed already, but I still had to restart Emacs
a couple of times, and what guarantees there will be no similar bugs in the
future?

Paul

On Tue, 28 May 2019 at 19:50, Stefan Monnier <address@hidden> wrote:
>
> > But would it make sense to adjust fontification code to disable
> > fontification in the current buffer if fontification function is
> > killed with C-g several times?
>
> Yes but: there's the obvious question of "how many C-g are
> necessary", as well as making sure this doesn't misfire just because the
> user hits C-g several times for some other reason.
>
> IOW, to do this, we'd need to make sure that Emacs was busy font-locking
> this one buffer during all this time, or something like that.
>
> Also, I get the impression that we'd want this kind of behavior for more
> than just font-lock.
>
>
>         Stefan
>



reply via email to

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