all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27470: 26.0.50; this-command-keys and interactive input
@ 2017-06-24  5:58 Michael Heerdegen
  2017-06-24  7:01 ` Eli Zaretskii
  2017-06-24 13:15 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Heerdegen @ 2017-06-24  5:58 UTC (permalink / raw)
  To: 27470


Hello,

Evaluate this:

(defun test (arg)
  (interactive (list (read-from-minibuffer "Input: ")))
  (message "%S" (cons this-command (this-command-keys)))
  arg)

(global-set-key [f12] #'test)

where f12 stands for some random key sequence.

Hit f12 and give any input.  I get the following message:

(test . "^M")

I would expect (test . f12).

Obviously, `this-command-keys' returns the key confirming the input
instead of the key that has invoked the command.  This contradicts the
descriptions in the documentation (docstring and manual).  The docs only
mention an exception when a command calls `read-key-sequence', but this
is not the case here.  FWIW, I would prefer fixing this over changing
the docs.


Thanks,

Michael.


In GNU Emacs 26.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-06-19 built on drachen
Repository revision: 1b75af59b305867c89271905be72a05d06a4eff4
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
System Description:	Debian GNU/Linux 9.0 (stretch)






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

end of thread, other threads:[~2017-07-28 12:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-24  5:58 bug#27470: 26.0.50; this-command-keys and interactive input Michael Heerdegen
2017-06-24  7:01 ` Eli Zaretskii
2017-06-25  5:53   ` Michael Heerdegen
2017-07-22  8:16   ` Eli Zaretskii
2017-07-23 15:44     ` Michael Heerdegen
2017-07-28 12:41       ` Eli Zaretskii
2017-06-24 13:15 ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.