From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: 22714@debbugs.gnu.org
Subject: bug#22714: 25.0.91; Minibuffer quirk in C-x r SPC
Date: Sat, 20 Feb 2016 15:32:33 -0500 [thread overview]
Message-ID: <jwvwppzkvr4.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAFyQvY1CMGUwX3=QP4E-bJ2-BvPvurU6TOLZCguvkskw4W9iLQ@mail.gmail.com> (Kaushal Modi's message of "Wed, 17 Feb 2016 09:07:55 -0500")
> Stefan should be able to comment more on why that changes the behavior of
> the prompt staying vs disappearing.
Good question. `read-key' uses `read-key-sequence' internally, and this
function has always left the prompt on display.
Maybe read-key should be changed to behave more like read-event (and
read-char), since it's typically used in the same kinds of situations.
IOW, we should probably install one of the two patches below.
Stefan
diff --git a/lisp/subr.el b/lisp/subr.el
index 7478595..cd1b945 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2116,6 +2116,10 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
(aref keys 1)
key)))
(cancel-timer timer)
+ ;; For some reason, `read-key(-sequence)' leaves the prompt in the echo
+ ;; area, whereas `read-event' seems to empty it just before returning
+ ;; (bug#22714). So, let's mimick the behavior of `read-event'.
+ (message nil)
(use-global-map old-global-map))))
(defun read-char (&optional prompt) ;; (inherit-input-method seconds)
diff --git a/lisp/register.el b/lisp/register.el
index faed49a..5fab2b0 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -164,6 +164,13 @@ display such a window regardless."
help-chars)
(unless (get-buffer-window buffer)
(register-preview buffer 'show-empty)))
+ ;; FIXME: For some reason, `read-key(-sequence)' leaves the prompt in
+ ;; the echo area, contrary to `read-event' which seems to empty it
+ ;; just before returning (bug#22714).
+ ;; Not sure what's the best fix: maybe read-key should be changed to
+ ;; behave like read-event. But in the mean time, the hack below
+ ;; should work.
+ (message nil)
(if (characterp last-input-event) last-input-event
(error "Non-character input-event")))
(and (timerp timer) (cancel-timer timer))
next prev parent reply other threads:[~2016-02-20 20:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 1:11 bug#22714: 25.0.91; Minibuffer quirk in C-x r SPC Steve Revilak
2016-02-17 13:56 ` Kaushal Modi
2016-02-17 14:07 ` Kaushal Modi
2016-02-20 20:32 ` Stefan Monnier [this message]
2016-04-08 15:26 ` Kaushal Modi
2016-04-08 18:02 ` Stefan Monnier
2016-04-08 18:24 ` Kaushal Modi
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvwppzkvr4.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=22714@debbugs.gnu.org \
--cc=kaushal.modi@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.