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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 22 Jul 2017 11:16:32 +0300

> Date: Sat, 24 Jun 2017 10:01:17 +0300
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked]
> 
> > From: Michael Heerdegen <[email-masked]>
> > Date: Sat, 24 Jun 2017 07:58:47 +0200
> > 
> > (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).
> 
> This happens because read-from-minibuffer enters recursive-edit, and
> we don't preserve this-command-keys across recursive-edit invocations.
> 
> This has been Emacs behavior since forever.
> 
> The patch below seems to fix this, but I have no idea what it could
> break, given how old this behavior is.  So if we are to accept this,
> I'd like to have a few people step forward and run with the change for
> a month or so, to see there are no adverse effects.  We've been burnt
> several times lately by changes in keyboard-input stuff that broke
> subtle but very useful features.

Michael, any findings so far?  Do you recommend that we push that
change?

Thanks.