bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22107: 25.1; Wrong docstring for this-single-command-keys


From: Artur Malabarba
Subject: 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 <address@hidden>:
>>> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]