unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Behavior of `this-command-keys'
@ 2006-09-11 17:54 Jay Belanger
  2006-09-11 22:13 ` Kim F. Storm
  2006-09-12  2:01 ` Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Jay Belanger @ 2006-09-11 17:54 UTC (permalink / raw)
  Cc: belanger


The behavior of `this-command-keys' doesn't seem to match its
documentation; perhaps I'm misunderstanding something.  The
documentation for `this-command-keys' is:
   This function returns a string or vector containing the key
   sequence that invoked the present command, plus any previous
   commands that generated the prefix argument for this command.
   However, if the command has called `read-key-sequence', it returns
   the last read key sequence.  *Note Key Sequence Input::.  The
   value is a string if all events in the sequence were characters
   that fit in a string.  *Note Input Events::.
Consider something like:
  (defun test ()
    (interactive)
    (sit-for 1)
    (setq result (this-command-keys)))
  (global-set-key "a" 'test)
To me, it sounds like as if `result' should equal "a" (the key which
calls the function) if "ab" were pressed, whether or not the `sit-for'
had run its course.  However, `result' equals "a" or "ab" depending on
how close together the "a" and "b" are pressed.

Jay

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

end of thread, other threads:[~2006-09-13 15:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-11 17:54 Behavior of `this-command-keys' Jay Belanger
2006-09-11 22:13 ` Kim F. Storm
2006-09-12 16:42   ` Jay Belanger
2006-09-12  2:01 ` Richard Stallman
2006-09-12 16:40   ` Jay Belanger
2006-09-13 15:10     ` Richard Stallman

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).