unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Reading key sequences followed by read-event.
@ 2005-05-09 16:12 Jay Belanger
  2005-05-11 16:29 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Jay Belanger @ 2005-05-09 16:12 UTC (permalink / raw)
  Cc: belanger


I would expect the following function to prompt for a key sequence, 
read it, then display a message "You just pressed ..." while waiting 
for another event.  
That's what it does if the key sequence is one character, but if it is
more than one character, then after the key sequence (say "ab") is read, 
the minibuffer appears again with the "Key sequence: a b-" prompt while 
waiting for another event.  
Is this expected behavior, and if so, how can I keep the echo area displayed?

(defun hmm (key)
  (interactive "kKey sequence: ")
  (message "You just pressed the key sequence %s" (key-description key))
  (read-event))

Thanks,
Jay

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reading key sequences followed by read-event.
  2005-05-09 16:12 Reading key sequences followed by read-event Jay Belanger
@ 2005-05-11 16:29 ` Richard Stallman
  2005-05-11 17:11   ` Jay Belanger
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2005-05-11 16:29 UTC (permalink / raw)
  Cc: belanger, emacs-devel

Does this patch fix it?

*** xdisp.c	02 May 2005 13:07:23 -0400	1.1007
--- xdisp.c	11 May 2005 06:40:06 -0400	
***************
*** 6934,6939 ****
--- 6934,6940 ----
  
    GCPRO1 (m);
    clear_message (1,1);
+   cancel_echoing ();
  
    /* First flush out any partial line written with print.  */
    message_log_maybe_newline ();

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Reading key sequences followed by read-event.
  2005-05-11 16:29 ` Richard Stallman
@ 2005-05-11 17:11   ` Jay Belanger
  0 siblings, 0 replies; 3+ messages in thread
From: Jay Belanger @ 2005-05-11 17:11 UTC (permalink / raw)
  Cc: belanger, emacs-devel


Richard Stallman <rms@gnu.org> writes:

> Does this patch fix it?

Yes; it works great.

> *** xdisp.c	02 May 2005 13:07:23 -0400	1.1007
> --- xdisp.c	11 May 2005 06:40:06 -0400
> ***************
> *** 6934,6939 ****
> --- 6934,6940 ----
>
>     GCPRO1 (m);
>     clear_message (1,1);
> +   cancel_echoing ();
>
>     /* First flush out any partial line written with print.  */
>     message_log_maybe_newline ();

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-11 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-09 16:12 Reading key sequences followed by read-event Jay Belanger
2005-05-11 16:29 ` Richard Stallman
2005-05-11 17:11   ` Jay Belanger

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).