emacs-devel
[Top][All Lists]
Advanced

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

Re: Qs on key-description, substitute-command-keys


From: Kevin Rodgers
Subject: Re: Qs on key-description, substitute-command-keys
Date: Wed, 05 Oct 2005 10:23:43 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Drew Adams wrote:
> Why was the output from `key-description' and `substitute-command-keys'
> changed to use angle brackets around simple key sequences like S-tab?

I would guess to make them consistent with kbd, insert-kdb-macro,
edit-kbd-macro, and view-lossage.

> I have, for instance, a help string that looks like this when displayed:
> (S-tab or TAB: list, C-h: help). I mean, that's what it looks like in Emacs
> 20 - in Emacs 22, the first key sequence is shown as <S-tab>, while the
> others remain simple, without angle brackets.

TAB (aka C-i) and C-h are ASCII characters and thus are categorized as
keyboard events.  <tab> is a function key, and <S-tab> is a modified
function key.

> I'm sure there are good reasons why this was changed, but I'm curious why.
>
> Is there another standard function I can call, perhaps in combination with
> `substitute-command-keys', to get the simpler representation, S-tab, from
> the less readable <S-tab>? Or should I just roll my own?

The Keyboard Events node of the Emacs Lisp manual says "The 2**25 bit in
the character code indicates an ASCII control character typed with the
shift key held down."  So if you want a Shift-TAB, try (kbd "S-TAB"),
[(shift ?\t)], or [?\S-\C-i].

> Also, is there a good way to control which of several key bindings for a
> command is output by `substitute-command-keys'? The only way I've found is > to make sure that the one I want is the last of the key sequences for that > command defined in the map - and that's not always feasible. I found nothing
> in the manual about which binding is displayed or how to control that.

--
Kevin Rodgers





reply via email to

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