Subject: bug#27470: closed (Re: bug#27470: 26.0.50; this-command-keys and interactive input)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 28 Jul 2017 12:43:02 +0000

Your bug report

#27470: 26.0.50; this-command-keys and interactive input

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
27470: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=27470
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#27470: 26.0.50; this-command-keys and interactive input
From: Eli Zaretskii <[email-masked]>
To: Michael Heerdegen <[email-masked]>
Cc: [email-masked]
Date: Fri, 28 Jul 2017 15:41:46 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Michael Heerdegen <[email-masked]>
> Cc: [email-masked]
> Date: Sun, 23 Jul 2017 17:44:21 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Michael, any findings so far?
> 
> No, everything seems to be fine.
> 
> > Do you recommend that we push that change?
> 
> It solves my problem, so - yes!  But I can't judge whether it could
> potentially cause any trouble.  Anyway, it's small and easily
> revertible, so I see no reason to hold it back.

Pushed to master.

Thanks for testing this.

Subject: 26.0.50; this-command-keys and interactive input
From: Michael Heerdegen <[email-masked]>
To: [email-masked]
Date: Sat, 24 Jun 2017 07:58:47 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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)