Subject: Re: bug#6881: 23.2; bookmark-bmenu-search makes menu disappear

From: Thierry Volpiatto <[email-masked]>
Date: Thu, 19 Aug 2010 11:22:08 +0200

Leo <[email-masked]> writes:

> This is a bug in read-key.

read-key should not echo the command in minibuffer.

> It appears using read-char solve this problem and the key echoing one.

Note that if read-char is used in `bookmark-read-search-input'
`inhibit-quit' need to be set to t, as read-char is not aware of C-g
like read-key.
It is safe to use inhibit-quit in bookmark-read-search-input, i use it
without problems since months in bookmark-extensions.el (with
read-char).
An alternative to read-char is to use most of the time read-char and
when read-char fail use read-event instead:

(defun ioccur-read-char-or-event (prompt)
  "Replace `read-key' when not available using PROMPT."
  (if (fboundp 'read-key)
      (read-key prompt)
->      (let* ((chr (condition-case nil (read-char prompt) (error nil)))
->             (evt (unless chr (read-event prompt))))
->        (or chr evt))))

-- 
Thierry Volpiatto
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997