From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>,
Emacs Development <emacs-devel@gnu.org>
Subject: RE: while-no-input and pending input (was: while-no-input interrupted by *shell*)
Date: Tue, 25 Sep 2018 10:53:36 -0700 (PDT) [thread overview]
Message-ID: <c0a78316-272a-4c9c-a811-647bb14160fe@default> (raw)
In-Reply-To: <87k1n94gg2.fsf@web.de>
> I ran into other trouble with `while-no-input': A command I use - it
> calls w-n-i to generate feedback for the echo area unless the user hits
> a key - sometimes needs to select a different frame. AFAIK this
> generates an event and w-n-i then does nothing because of its implicit
> `input-pending-p' test.
>
> Using a modified version of w-n-i with the input-pending-p test removed
> solves the problem, but that's not good because (1) I have to duplicate
> the definition of w-n-i in my code (it's what Helm does btw.) and (2)
> hmm, can doing this have downsides?
>
> What could I else do in this situation to prevent the frame switch or
> whatever event to be misinterpreted as user input? Could/should w-n-i
> generally ignore events in `while-no-input-ignore-events' - I mean, also
> the input-pending-p part?
Dunno whether this helps or whether it's a good idea, but this is what I do:
(defun icicle-skip-this-command ()
"Prevent `handle-switch-frame' from being added to `this-command'."
(interactive)
(setq this-command last-command))
(defun icicle-handle-switch-frame (event)
"Call `handle-switch-frame', but don't add it to `this-command'."
(interactive "e")
(handle-switch-frame event)
(setq this-command last-command))
(define-key global-map [handle-switch-frame] 'icicle-skip-this-command)
(define-key global-map [switch-frame] 'icicle-handle-switch-frame))
next prev parent reply other threads:[~2018-09-25 17:53 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-24 15:24 while-no-input interrupted by *shell* Michael Heerdegen
2018-09-24 16:14 ` Eli Zaretskii
2018-09-24 16:40 ` Stefan Monnier
2018-09-24 17:00 ` Eli Zaretskii
2018-09-24 18:35 ` Stefan Monnier
2018-09-24 18:48 ` Eli Zaretskii
2018-09-24 17:39 ` Michael Heerdegen
2018-09-24 18:00 ` Eli Zaretskii
2018-09-24 19:09 ` Michael Heerdegen
2018-09-24 19:06 ` Stefan Monnier
2018-09-25 13:09 ` Eli Zaretskii
2018-09-25 13:39 ` Michael Heerdegen
2018-09-25 14:14 ` Eli Zaretskii
2018-09-29 7:13 ` Eli Zaretskii
2018-09-25 15:25 ` BUFFER_SWITCH_EVENT (was: while-no-input interrupted by *shell*) Stefan Monnier
2018-09-25 16:01 ` Eli Zaretskii
2018-09-25 16:14 ` BUFFER_SWITCH_EVENT Stefan Monnier
2018-09-25 16:28 ` BUFFER_SWITCH_EVENT Eli Zaretskii
2018-09-25 17:19 ` BUFFER_SWITCH_EVENT Stefan Monnier
2018-09-25 17:28 ` BUFFER_SWITCH_EVENT Eli Zaretskii
2018-09-25 18:14 ` BUFFER_SWITCH_EVENT Stefan Monnier
2018-09-25 18:32 ` BUFFER_SWITCH_EVENT Eli Zaretskii
2018-09-25 19:05 ` BUFFER_SWITCH_EVENT Eli Zaretskii
2018-09-25 21:50 ` BUFFER_SWITCH_EVENT Stefan Monnier
2018-09-26 5:42 ` BUFFER_SWITCH_EVENT Eli Zaretskii
2018-09-26 12:27 ` BUFFER_SWITCH_EVENT Stefan Monnier
2018-09-24 21:23 ` while-no-input interrupted by *shell* Andreas Schwab
2018-09-25 10:36 ` Michael Heerdegen
2018-09-24 16:19 ` Stefan Monnier
2018-09-25 17:47 ` while-no-input and pending input (was: while-no-input interrupted by *shell*) Michael Heerdegen
2018-09-25 17:53 ` Drew Adams [this message]
2018-09-26 12:50 ` while-no-input and pending input Michael Heerdegen
2018-09-26 14:18 ` while-no-input and pending input (was: while-no-input interrupted by *shell*) Eli Zaretskii
2018-09-26 17:57 ` while-no-input and pending input Michael Heerdegen
2018-09-26 19:06 ` Eli Zaretskii
2018-10-12 15:38 ` Michael Heerdegen
2018-10-12 15:44 ` Stefan Monnier
2019-02-17 23:44 ` Michael Heerdegen
2019-02-18 17:08 ` Eli Zaretskii
2019-02-18 19:08 ` Óscar Fuentes
2019-02-18 19:23 ` Eli Zaretskii
2019-02-18 22:32 ` Michael Heerdegen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c0a78316-272a-4c9c-a811-647bb14160fe@default \
--to=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=michael_heerdegen@web.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).