get the binding in macro notation for this-command
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
get the binding in macro notation for this-command         


Author: Xah
Date: Sep 8, 2008 13:56

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?

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.

here's some detail of what i want to do:

Basically, i want to write a function like this:

(global-set-key (kbd "C-a") 'binding-changed-notify)
Show full article (1.27Kb)
1 Comment
Re: get the binding in macro notation for this-command         


Author: Kevin Rodgers
Date: Sep 9, 2008 00:26

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]
`----
Show full article (1.43Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
A MACRO HELP NEEDED - I am new in Macro (please help me)comp.softsys.sas ·