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

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

Re: Remapping Control-[


From: François Gannaz
Subject: Re: Remapping Control-[
Date: Fri, 3 Feb 2006 22:06:51 +0100
User-agent: Mutt/1.5.11

Le ven 03 fév 09:44, Kevin Rodgers a écrit :
> François Gannaz wrote:
> >Le jeu 02 fév 11:57, Tim Johnson a écrit :
> >
> >>Howdy:
> >>
> >>I use linux. On my machine, emacs interprets Control-[
> >>as ESC. Is is possible to ovveride this feature?
> >
> >
> >This would make Control-[ behave as Control-h :
> >(keyboard-translate ?\C-\[ ?\C-h)
> 
> In Emacs 21.4 on Solaris, that signals an error:
> 
> Lisp error: (void-variable \[)
> 
> But in any case, wouldn't that keyboard translation also force Emacs to
> interpret ESC as Control-h, because:
> 
> (= (aref "\C-[" 0) ?\e) => t

I'm not really sure how it should behave. In X.org on Linux, the two of
them behave differently after this keyboard-translate. In a terminal, it
changes the ESC behaviour. And I don't know what would happen with
Windows.

So on a X session of Emacs, this should translate C-[ to a key. Then
it's up to you to assign this key to any function, keeping ESC
unchanged.

The Emacs manual has an info node "Named ASCII Control Characters", but
I couldn't make anything out of it :

|    <TAB>, <RET>, <BS>, <LFD>, <ESC> and <DEL> started out as names for
| certain ASCII control characters, used so often that they have special
| keys of their own.  Later, users found it convenient to distinguish in
| Emacs between these keys and the "same" control characters typed with
| the <CTRL> key.
|
|    Emacs distinguishes these two kinds of input, when the keyboard
| reports these keys to Emacs.  It treats the "special" keys as function
| keys named `tab', `return', `backspace', `linefeed', `escape', and
| `delete'.  These function keys translate automatically into the
| corresponding ASCII characters _if_ they have no bindings of their own.
| As a result, neither users nor Lisp programs need to pay attention to
| the distinction unless they care to.
|
|    If you do not want to distinguish between (for example) <TAB> and
| `C-i', make just one binding, for the ASCII character <TAB> (octal code
| 011).  If you do want to distinguish, make one binding for this ASCII
| character, and another for the "function key" `tab'.
|
|    With an ordinary ASCII terminal, there is no way to distinguish
| between <TAB> and `C-i' (and likewise for other such pairs), because
| the terminal sends the same character in both cases.

--
François Gannaz




reply via email to

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