From: Noam Postavsky <npostavs@gmail.com>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: catching keyboard-quit from read-char
Date: Fri, 27 Jul 2018 12:00:04 -0400 [thread overview]
Message-ID: <CAM-tV-_SgyXNA71HfejOkWuPQ8QmR0DBN81HuNXqyRTOLRJ1tA@mail.gmail.com> (raw)
In-Reply-To: <87woth3gt0.fsf@ericabrahamsen.net>
On 26 July 2018 at 16:03, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
> My use case above is prompting for a character to use as a register
> name. I guess I can just use `read-char-choice', offering as choices all
> the valid register keys from `register-alist'. The only downside is that
> if the user enters an invalid character nothing happens: there's no
> message indicating that they've entered an invalid character, it just
> sits and waits for valid input.
Why not use register-read-with-preview (uses read-key), which seems
like the function specifically made for this?
Other possibilities are read-multiple-choice (currently uses
read-char, but maybe should be changed to read-event, see Bug#32257),
read-answer (uses read-from-minibuffer + keymap) which is new in
master, but I plan to backport to emacs-26 soon (see Bug#31782).
next prev parent reply other threads:[~2018-07-27 16:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-25 22:11 catching keyboard-quit from read-char Eric Abrahamsen
2018-07-26 20:03 ` Eric Abrahamsen
2018-07-27 16:00 ` Noam Postavsky [this message]
2018-07-27 17:15 ` Eric Abrahamsen
2018-07-28 1: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
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=CAM-tV-_SgyXNA71HfejOkWuPQ8QmR0DBN81HuNXqyRTOLRJ1tA@mail.gmail.com \
--to=npostavs@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=eric@ericabrahamsen.net \
/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).