[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: catching keyboard-quit from read-char
From: |
Noam Postavsky |
Subject: |
Re: catching keyboard-quit from read-char |
Date: |
Fri, 27 Jul 2018 12:00:04 -0400 |
On 26 July 2018 at 16:03, Eric Abrahamsen <address@hidden> 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).