From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 10477@debbugs.gnu.org, jidanni@jidanni.org
Subject: bug#10477: zap-to-char should allow picking from history
Date: Tue, 29 Oct 2019 00:17:56 +0200 [thread overview]
Message-ID: <87h83stsyz.fsf@mail.linkov.net> (raw)
In-Reply-To: <87r22xb0xt.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 28 Oct 2019 11:48:30 +0100")
>> Using read-from-minibuffer would allow this for free.
>
> How would you implement read-char-with-history using
> read-from-minibuffer? Rebind self-insert-command?
Exactly, by rebinding self-insert-command:
(defvar read-char-from-minibuffer-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map minibuffer-local-map)
(define-key map [remap self-insert-command]
(lambda ()
(interactive)
(delete-minibuffer-contents)
(insert (event-basic-type last-command-event))
(exit-minibuffer)))
map))
(defun read-char-from-minibuffer (prompt)
(read-from-minibuffer prompt nil
read-char-from-minibuffer-map nil
'read-char-from-minibuffer-history))
(read-char-from-minibuffer "Please type a character: ")
next prev parent reply other threads:[~2019-10-28 22:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-11 3:27 bug#10477: zap-to-char should allow picking from history jidanni
2012-01-15 1:23 ` Drew Adams
2012-01-15 1:38 ` jidanni
2012-01-15 3:47 ` Drew Adams
2019-10-14 3:11 ` Lars Ingebrigtsen
2019-10-27 21:30 ` Juri Linkov
2019-10-27 22:14 ` Lars Ingebrigtsen
2019-10-27 22:34 ` Juri Linkov
2019-10-28 10:48 ` Lars Ingebrigtsen
2019-10-28 22:17 ` Juri Linkov [this message]
2019-10-29 11:32 ` Lars Ingebrigtsen
2019-10-29 23:01 ` Lars Ingebrigtsen
2019-10-30 0:00 ` Juri Linkov
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=87h83stsyz.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=10477@debbugs.gnu.org \
--cc=jidanni@jidanni.org \
--cc=larsi@gnus.org \
/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).