GNU bug report logs - #22107
this-command-keys no longer returns prefix argument

Previous Next

Package: emacs;

Reported by: bruce.connor.am <at> gmail.com

Date: Mon, 7 Dec 2015 15:43:02 UTC

Severity: normal

Tags: fixed

Merged with 22111

Found in versions 25.0.50, 25.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #55 received at 22107 <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 22107 <at> debbugs.gnu.org
Subject: Re: bug#22107: 25.1; Wrong docstring for this-single-command-keys
Date: Fri, 11 Dec 2015 15:39:46 +0000
2015-12-11 14:44 GMT+00:00 Stefan Monnier <monnier <at> iro.umontreal.ca>:
>>> Indeed, C-u is now a completely normal command so there's no special
>>> handling of "prefix commands" for this-command-keys.
>>> Could you tel us where that caused a problem for you?
>> I wrote a package for use in screencasts, which displays the key for
>> some commands when you invoke them.  And I wanted it to show prefix
>> args too.
>
> Could you give some details?  More specifically, doesn't the screen-cast
> already give you the C-u when the prefix command itself is run?

It can be made to, yes. But I wanted the C-u it to be displayed as
part of the following command.
The point of this little package is that it doesn't display every
single key combo you use. It only displays the keybind of a few
commands that you specify in advance (so it only shows the commands
you're trying to teach).

So you run something like (display-keys-for-commands '(eval-last-sexp
eval-buffer eval-defun)). From there on, wherever you type C-x C-e, a
small frame will popup saying:
   eval-last-sexp
   C-x C-e
(where C-x C-e is in a big bright font).

Now I also want to teach viewers that hitting C-u C-x C-e will insert
the results of evaluation.
I could add `universal-argument' to that list of commands for which it
will show the key, but then it will report that C-u was pressed even
when it is pressed before some command that I don't care about (like
C-n or C-p). This is a sensible behavior given that C-u is a command
like any other, but it would be confusing for viewers who don't
understand this technicality.

Right now, I've just patched my own code to display something like
this in that situation (and I'm happy with it):
   eval-last-sexp (with prefix)
   C-u C-x C-e




This bug report was last modified 4 years and 228 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.