all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* "translated from" keystrokes
@ 2004-09-16 16:48 J. David Boyd
  2004-09-25 20:51 ` Kai Grossjohann
  0 siblings, 1 reply; 4+ messages in thread
From: J. David Boyd @ 2004-09-16 16:48 UTC (permalink / raw)



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.

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.

Any clues, please?

Dave

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "translated from" keystrokes
       [not found] <mailman.3011.1095353729.1998.help-gnu-emacs@gnu.org>
@ 2004-09-16 17:34 ` Walker Pendleton
  2004-09-16 19:31   ` J. David Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Walker Pendleton @ 2004-09-16 17:34 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "translated from" keystrokes
  2004-09-16 17:34 ` "translated from" keystrokes Walker Pendleton
@ 2004-09-16 19:31   ` J. David Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: J. David Boyd @ 2004-09-16 19:31 UTC (permalink / raw)


Walker Pendleton <wpendleton@kitinteractive.com> writes:

> 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.

Ah, great tip, and it worked perfectly.  Thank you so much!

Dave

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "translated from" keystrokes
  2004-09-16 16:48 J. David Boyd
@ 2004-09-25 20:51 ` Kai Grossjohann
  0 siblings, 0 replies; 4+ messages in thread
From: Kai Grossjohann @ 2004-09-25 20:51 UTC (permalink / raw)


dave@adboyd.com (J. David Boyd) writes:

> 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.

The reason for this automatic translation is so that C-w works even if
caps lock is on.

Kai

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-25 20:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3011.1095353729.1998.help-gnu-emacs@gnu.org>
2004-09-16 17:34 ` "translated from" keystrokes Walker Pendleton
2004-09-16 19:31   ` J. David Boyd
2004-09-16 16:48 J. David Boyd
2004-09-25 20:51 ` Kai Grossjohann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.