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

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

Re: get the binding in macro notation for this-command


From: Kevin Rodgers
Subject: Re: get the binding in macro notation for this-command
Date: Tue, 09 Sep 2008 01:26:10 -0600
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)

Xah wrote:
There's this-command-keys and this-command-keys-vector. Is there
a command that returns using the syntax of keyboard macro like
“M-‹key›” or “C-‹key›”? Or, how to convert the above to the macro
syntax string?

,----[ C-h f key-description RET ]
| key-description is a built-in function in `C source code'.
| (key-description keys &optional prefix)
|
| Return a pretty description of key-sequence keys.
| Optional arg prefix is the sequence of keys leading up to keys.
| Control characters turn into "C-foo" sequences, meta into "M-foo",
| spaces are put between sequence elements, etc.
|
| [back]
`----

also when i do M-x narrow-to-region, emacs will tell me that it is
bound to C-x n n. Similar for other command that has a binding but
called with M-x. How to find out programatically the keys of a given
command? I looked at the source but didn't see any mechanism that
reminds user of a existence of a binding.

,----[ C-h f where-is RET ]
| where-is is an interactive compiled Lisp function in `help.el'.
| It is bound to C-h w, <f1> w, <help> w.
| (where-is definition &optional insert)
|
| Print message listing key sequences that invoke the command definition.
| Argument is a command definition, usually a symbol with a function definition.
| If insert (the prefix arg) is non-nil, insert the message in the buffer.
`----

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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