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

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

Re: Separate bindings for the keyboard shortcuts Ctrl-i and TAB.


From: Harald Hanche-Olsen
Subject: Re: Separate bindings for the keyboard shortcuts Ctrl-i and TAB.
Date: Mon, 17 Sep 2007 15:25:54 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (berkeley-unix)

+ Peter Dyballa <Peter_Dyballa@Web.DE>:

> Am 17.09.2007 um 10:49 schrieb Nordlöw:
>
>> The reason is that I want Ctrl-i to indent as usual
>> and TAB to do completion (hippie-expand) instead.
>
> By law (ASCII, ISO 8859, Unicode, and proprietary standards) both are
> the same.
>
> In X11 you can map whatever to the TAB key.

In X11 the <tab> key is, by default, mapped to the TAB character
(ASCII 9).  This is done in function-key-map, so to map <tab> and C-i
to different keys, the sensible ting would be to remove the <tab>
translation from function-key-map, then rebind it to whatever you
wish.  Note, however, that since function-key-map is a global map,
applied before any other key processing, this will have side effects
in /every/ mode, not just where you wanted separate definitions.  You
could circumvent this in various hackish ways, I suppose, like binding
<tab> in the global keymap to a function that looks up C-i in the
current keymaps and executes the result.  But I don't know enough
about event handling in emacs to tell you what the gotchas of such an
approach might be.  Maybe you could bind <tab> to a macro that runs
C-i?  Might be worth a try.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


reply via email to

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