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

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

RE: [External] : Re: Trapping prefixes with universal argument component


From: Drew Adams
Subject: RE: [External] : Re: Trapping prefixes with universal argument component
Date: Sat, 21 Aug 2021 20:08:45 +0000

> > Neither did reassigning M-kp-0
> Hm, maybe it should be put like this: M-<kp-0> ?
>   (define-key input-decode-map [M-<kp-0>] nil)

The way to get such things right, assuming that your
keyboard and Emacs can effect the key, is to do this:

1. Use `C-h k' to find out how Emacs itself describes
   (names) the key sequence.  This tells me:

   M-0 (translated from <M-kp-0>) runs the command...

2. Change that to a string by wrapping with "...":
   "<M-kp-0>".

3. Pass that to `kbd': (kbd "<M-kp-0>")

That's your answer.  And if you want to see what
that ends up being (but you [M-kp-0]don't need to), eval
it: the result is [M-kp-0].

So you can use either (kbd "<M-kp-0>") or [M-kp-0].

Moral: Ask Emacs.  Emacs will tell you what to call
any key sequence.  Then feed that to `kbd'.  CQFD.

<<attachment: winmail.dat>>


reply via email to

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