GNU bug report logs - #58808
map-y-or-n-p should use read-key, not read-event

Previous Next

Package: emacs;

Reported by: meedstrom <at> teknik.io

Date: Thu, 27 Oct 2022 01:01:02 UTC

Severity: normal

Full log


Message #8 received at 58808 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: meedstrom <at> teknik.io, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 58808 <at> debbugs.gnu.org
Subject: Re: bug#58808: map-y-or-n-p should use read-key, not read-event
Date: Thu, 27 Oct 2022 08:58:53 +0300
> 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 <at> 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.)




This bug report was last modified 2 years and 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.