GNU bug report logs - #6883
23.2; `read-key' echos keys in the minibuffer

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Thu, 19 Aug 2010 15:20:03 UTC

Severity: normal

Found in version 23.2

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#6883: closed (23.2; `read-key' echos keys in the minibuffer)
Date: Sat, 21 Aug 2010 13:09:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 21 Aug 2010 11:00:15 +0200
with message-id <jwvlj80s67d.fsf-monnier+emacs <at> gnu.org>
and subject line Re: 23.2; `read-key' echos keys in the minibuffer
has caused the GNU bug report #6883,
regarding 23.2; `read-key' echos keys in the minibuffer
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
6883: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6883
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, thierry.volpiatto <at> gmail.com
Subject: 23.2; `read-key' echos keys in the minibuffer
Date: Thu, 19 Aug 2010 16:20:38 +0100
1. Define bookmark-read-search-input as this which inserts a (sit-for 1) to
demonstrate the bug easily:

(defun bookmark-read-search-input ()
  (let ((prompt       (propertize "Pattern: " 'face 'minibuffer-prompt))
        (tmp-list     ()))
    (while
        (let ((char (read-key (concat prompt bookmark-search-pattern))))
          (sit-for 1)
          (case char
            ((?\e ?\r) nil) ; RET or ESC break the search loop.
            (?\C-g (setq bookmark-quit-flag t) nil)
            (?\d (pop tmp-list) t) ; Delete last char of pattern with DEL
            (t
             (if (characterp char)
                 (push char tmp-list)
               (setq unread-command-events
                     (nconc (mapcar 'identity
                                    (this-single-command-raw-keys))
                            unread-command-events))
               nil))))
      (setq bookmark-search-pattern
            (apply 'string (reverse tmp-list))))))

2. and eval

  (let (bookmark-search-pattern) (bookmark-read-search-input))

3. then start typing away.

You should see each key is echoed. So for example if you hit backspace
you may see backspace or DEL in the echo area twice.

With the original definition back (ie without the sit-for) you can
observe a trail for each key you type by for example doing something
like this:

  1. C-x r l to list bookmarks
  2. M-g s and start typing away

That breaks the smooth flow of key strokes.

Thierry Volpiatto, YAMAMOTO Mitsuharu and I can observe this on all
three major platforms. On some platforms, it happens so fast that it is
hardly annoying, on others you can read the echoing literally.
`read-char' does not have this problem and thus Thierry's suggestion to
use it instead.

Leo


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo <sdl.web <at> gmail.com>
Cc: thierry.volpiatto <at> gmail.com
Subject: Re: 23.2; `read-key' echos keys in the minibuffer
Date: Sat, 21 Aug 2010 11:00:15 +0200
>> Does the trivial patch below fix the problem?
> Yes and thanks.

Great, I've installed it in the emacs-23 branch,


        Stefan


This bug report was last modified 14 years and 278 days ago.

Previous Next


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