From: Paul Pogonyshev <pogonyshev@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Signal `quit' in a `font-lock-fontify-region-function'
Date: Tue, 28 May 2019 20:14:11 +0200 [thread overview]
Message-ID: <CAG7BpaqFqw3ey_rnGoGiLA2ESsqtOdhUnuH6H9xvJhKLKHR=xQ@mail.gmail.com> (raw)
In-Reply-To: <jwv1s0iv5f7.fsf-monnier+emacs@gnu.org>
> 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 <monnier@iro.umontreal.ca> 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
>
next prev parent reply other threads:[~2019-05-28 18:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 16:24 Signal `quit' in a `font-lock-fontify-region-function' Paul Pogonyshev
2019-05-28 17:50 ` Stefan Monnier
2019-05-28 18:14 ` Paul Pogonyshev [this message]
2019-05-28 18:24 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2019-06-29 17:50 Paul Pogonyshev
2019-06-29 21:26 ` Stefan Monnier
2019-06-29 23:49 ` Paul Pogonyshev
2019-06-30 0:18 ` Stefan Monnier
2019-06-30 10:51 ` Paul Pogonyshev
2019-05-16 22:20 Paul Pogonyshev
2019-05-16 23:20 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAG7BpaqFqw3ey_rnGoGiLA2ESsqtOdhUnuH6H9xvJhKLKHR=xQ@mail.gmail.com' \
--to=pogonyshev@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.