[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23204: 25.1.50; Strange behaviour of ‘read-char’

From: Eli Zaretskii
Subject: bug#23204: 25.1.50; Strange behaviour of ‘read-char’
Date: Sun, 03 Apr 2016 17:56:39 +0300

> From: Mark Karpov <address@hidden>
> Date: Sun, 03 Apr 2016 16:32:33 +0600
>   (defun my-command ()
>     (interactive)
>     (while (read-char "My prompt…" t)))
> Now if you call this from lisp or like this: ‘M-x my-command RET’,
> everything is fine: you see the prompt and you can type some chars
> (press ‘C-g’ to get out of this).
> But if you bind the command to key sequence, like this:
>   (global-set-key (kbd "<menu> t y") #'my-command)
> Then you have a nasty problem when you actually call it. Try to call it
> and then type some characters — you will see no prompt and they will
> accumulate in echo area indefinitely:
>   menu t y h e r e SPC I SPC t y p e SPC t h i n g s SPC a n d SPC i t
>   SPC i s SPC g e t t i n g SPC r a t h e r SPC l o n g

What if you do this instead:

  (global-set-key (kbd "<f8>") #'my-command)

Does this work as expected?  If so, does that explain what happens in
your original example?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]