* discard-input - why do I need it?
@ 2022-01-10 14:12 Michael Heerdegen
2022-01-10 22:18 ` Stefan Monnier via Users list for the GNU Emacs text editor
0 siblings, 1 reply; 2+ messages in thread
From: Michael Heerdegen @ 2022-01-10 14:12 UTC (permalink / raw)
To: Emacs mailing list
Hello,
in "el-search" I do a lot of computations "in the background", and these
can all be interrupted by the user. This is implemented using timers and
`while-no-input' calls. Oh, and I also use transient maps in a few
locations.
It seems that using this stuff in my case sometimes makes
`discard-input' calls necessary. Because sometimes, a `while-no-input'
is interrupted without any apparent physical user interaction. I once
looked at the pending input and it had been a key whose binding already
had been processed. With other words: the command invoked by the key
was being processed, but the key was still pending.
Using these `discard-input' calls is extremely ugly and a pain: it's
more or less guessing where they should be best put to, and a downside
is that sometimes "real" user interactions are discarded and ignored.
Does anybody have an idea why I see this kind of problem (using one of
these crystal balls maybe?) or what I could do better to avoid the
trouble?
TIA,
Michael.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: discard-input - why do I need it?
2022-01-10 14:12 discard-input - why do I need it? Michael Heerdegen
@ 2022-01-10 22:18 ` Stefan Monnier via Users list for the GNU Emacs text editor
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2022-01-10 22:18 UTC (permalink / raw)
To: help-gnu-emacs
> had been processed. With other words: the command invoked by the key
> was being processed, but the key was still pending.
Sounds like a bug. The call to `discard-input` is probably just hiding
the actual problem.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-10 22:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-10 14:12 discard-input - why do I need it? Michael Heerdegen
2022-01-10 22:18 ` Stefan Monnier via Users list for the GNU Emacs text editor
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.