unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: meedstrom@teknik.io, Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 58808@debbugs.gnu.org
Subject: bug#58808: map-y-or-n-p should use read-key, not read-event
Date: Thu, 27 Oct 2022 08:58:53 +0300	[thread overview]
Message-ID: <83fsf9n6xu.fsf@gnu.org> (raw)
In-Reply-To: <26bfd854bff2e7ccb0de0f1acb20ce2ced6e006a@teknik.io> (bug-gnu-emacs@gnu.org)

> Date: Wed, 26 Oct 2022 23:59:46 +0000
> From: meedstrom--- via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> I found that map-y-or-n-p uses read-event, not read-key (still the case in master as of 2022-10-27).  Will you
> accept a patch if I try to rewrite it?
> 
> Background: I like to translate <escape> to C-g, so I can hit the physical Esc key.  It almost always works,
> except in two cases; when Emacs freezes, and when something calls map-y-or-n-p, like the command M-x
> save-some-buffers.
> 
> An additional concern is that while map-y-or-n-p is doing its thing, even the triplet ESC ESC ESC does not
> work!
> 
> Steps to reproduce:
> 
> 1. Start Emacs -Q
> 2. Eval (define-key function-key-map (kbd "<escape>") (kbd "C-g"))
> 3. Edit some new file
> 4. Type C-x s to trigger save-some-buffers
> 5. Attempt to cancel by hitting the Escape key

Isn't there some translation map that could help you?

Adding Stefan to CC, in case he has comments.

(I'd assume that map-y-or-n-p would work like y-or-n-p, including
support for y-or-n-p-use-read-key, but evidently it doesn't, which is
surprising, I think.)





  reply	other threads:[~2022-10-27  5:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 23:59 bug#58808: map-y-or-n-p should use read-key, not read-event meedstrom--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-27  5:58 ` Eli Zaretskii [this message]
2022-10-27 15:39   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-08 22:51     ` Jeremy Bryant
2023-02-08 23:59       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-27 11:01 ` meedstrom--- via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=83fsf9n6xu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=58808@debbugs.gnu.org \
    --cc=meedstrom@teknik.io \
    --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 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).