[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "translated from" keystrokes
From: |
Walker Pendleton |
Subject: |
Re: "translated from" keystrokes |
Date: |
Thu, 16 Sep 2004 10:34:11 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
On 16 Sep 2004, J. David Boyd wrote:
> When I C-h k C-S-w, I get this message:
>
> C-w (translated from C-S-w) runs the command kill-region
>
> I looked through the emacs docs, and it says that key translations
> are explained in the elisp manual, and I've read through that, but
> probably not enough, as I still don't know how to break this
> translation, so I can assign a function to C-S-w.
>
> Now, I can put the following text into my scratch buffer
> (global-set-key [control shift w] 'emacs-uptime) and evaluate it
> with C-x C-e, and the mode line says emacs-uptime.
Try using "kbd" in your call to global-set-key. I find it's syntax
much easier to figure out than trying to give emacs the `canonical
name' of a particular key sequence.
,----
| (global-set-key (kbd "C-S-w") 'emacs-uptime)
`----
> Still, C-h k C-S-w reports kill-region. Actually, C-h k shows that
> it is reporting on C-w, so the key translation must be happening at
> a very low level.
The translation only happens if there's no C-S-w binding.