all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael_heerdegen@web.de, radon.neon@gmail.com, 31692@debbugs.gnu.org
Subject: bug#31692: Emacs sometimes drops key events
Date: Thu, 07 Jun 2018 14:44:36 -0400	[thread overview]
Message-ID: <jwvo9gmla1v.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <83602uwq3y.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 07 Jun 2018 18:52:49 +0300")

>> I don't understand the (throw 'throw-on-input t)
>> (throw throw-on-input t) would make more sense, but in any case we're
>> just about to exit that `catch` so throwing won't have any real effect.
> I hoped the comment explained that, but evidently not.

I think I understood the comment (and the email message before that ;-),
and your analysis makes a lot of sense, but AFAICT the "normal" way this
special quit-flag value is handled in the C code (see process_quit_flag
in src/eval.c) is to

   - read quit-flag
   - notice it's `eq`ual to the value of throw-on-input
   - set quit-flag to nil
   - throw to the flag's value

so the throw is not done to the constant symbol `throw-on-input` but to
the value of this variable, and the magic doesn't happen in response to
this throw (i.e. it's not done within the implementation of the
throw/catch code), but instead it happens before the throw.

As a consequence, instead of

    (throw 'throw-on-input t)

we need to throw like

    (throw throw-on-input t)

and we additionally need to (setq quit-flag nil) before that.

>> I think instead of (throw 'throw-on-input t) what is needed here is
>> 
>>     (setq quit-flag nil)
>> 
>> which will also make the body return nil (rather than t like (throw
>> throw-on-input t) would), which I believe is also the right thing.
>
> I believe we need to return t here, because input did arrive.

Indeed, I had missed that

So I suggest

    (progn (setq quit-flag nil) t)

We could also use (throw throw-on-input t) after the setq, but I don't
see the point since it seems it would give exactly the same result just
in a more costly way.


        Stefan





  reply	other threads:[~2018-06-07 18:44 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-03  2:21 bug#31692: Emacs sometimes drops key events Radon Rosborough
2018-06-03  2:36 ` Eli Zaretskii
2018-06-03  4:54   ` Radon Rosborough
2018-06-03 15:05     ` Eli Zaretskii
2018-06-03 19:23       ` Alan Third
2018-06-04 10:41         ` João Távora
2018-06-05  0:59   ` Michael Heerdegen
2018-06-05  2:37     ` Eli Zaretskii
2018-06-05  2:41       ` Radon Rosborough
2018-06-05  4:11         ` Eli Zaretskii
2018-06-05 21:40           ` Michael Heerdegen
2018-06-06  2:37             ` Eli Zaretskii
2018-06-06  2:58               ` Michael Heerdegen
2018-06-06 14:52                 ` Eli Zaretskii
2018-06-06 23:12                   ` Michael Heerdegen
2018-06-07 15:20                     ` Eli Zaretskii
2018-06-06 14:45             ` Eli Zaretskii
2018-06-06 22:50               ` Michael Heerdegen
2018-06-07 15:20                 ` Eli Zaretskii
2018-06-07 15:30                   ` Stefan Monnier
2018-06-07 15:52                     ` Eli Zaretskii
2018-06-07 18:44                       ` Stefan Monnier [this message]
2018-06-08 22:17                         ` Michael Heerdegen
2018-06-11 21:08                           ` Michael Heerdegen
2018-06-12  2:27                             ` Eli Zaretskii
2018-06-16  8:26                               ` Eli Zaretskii
2018-06-16  8:28                           ` Eli Zaretskii
2018-06-17  4:39                             ` Michael Heerdegen
2018-07-05 19:07                             ` Michael Heerdegen
2018-07-05 19:27                               ` Eli Zaretskii
2018-07-06 17:43                                 ` Michael Heerdegen
2018-06-05  2:48       ` Michael Heerdegen
2018-06-05  4:13         ` Eli Zaretskii
2018-06-05 11:57           ` Noam Postavsky
2018-06-05 14:31             ` Eli Zaretskii
2018-06-05 21:39               ` Artur Malabarba
2018-06-06 14:39                 ` Eli Zaretskii
2018-06-03 12:13 ` Noam Postavsky

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=jwvo9gmla1v.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=31692@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=radon.neon@gmail.com \
    /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.