GNU bug report logs - #22714
25.0.91; Minibuffer quirk in C-x r SPC

Previous Next

Package: emacs;

Reported by: Steve Revilak <steve <at> srevilak.net>

Date: Wed, 17 Feb 2016 01:13:02 UTC

Severity: normal

Merged with 22810

Found in version 25.0.91

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 22714 <at> debbugs.gnu.org
Subject: bug#22714: 25.0.91; Minibuffer quirk in C-x r SPC
Date: Fri, 08 Apr 2016 15:26:00 +0000
[Message part 1 (text/plain, inline)]
Hi Stefan,

I am not a good judge for this. Can you please commit the fix that feels
the most right?

On Sat, Feb 20, 2016 at 3:32 PM Stefan Monnier <monnier <at> iro.umontreal.ca>
wrote:

> > 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))
>
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 45 days ago.

Previous Next


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