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

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

Re: Binding C-i without losing <tab> functionality


From: Xah
Subject: Re: Binding C-i without losing <tab> functionality
Date: Fri, 24 Oct 2008 01:44:27 -0700 (PDT)
User-agent: G2/1.0

On Oct 23, 5:56 pm, Joseph Peterson <jeepeter...@yahoo.com> wrote:
> Hello all,
>
> I'm trying to bind C-i to isearch-forward, but I'm having some problems.
>
> It doesn't change anything when I do this or variations of this:
>   (global-set-key [?\C-i] 'isearch-forward)
>
> Sometimes it seems like it will work, but it rebinds the tab key, too
> (I may be remembering when I bound TAB, though...)
>
> If I bind both <tab> and C-i, then it seems that I can rebind C-i to be
> different than <tab>. Like this:
>   (global-set-key [tab] 'c-indent-command)
>   (global-set-key [?\C-i] 'isearch-forward)
>
> Then it seems to work, but then I lose all the mode-specific bindings.
> (Most annoying is the loss of mini-buffer completion). How do I bind
> C-i without affecting the Tab key?

not sure if you can. Because i think internally Ctrl+i and Tab are
both rerpresented by ascii 9. (ascii 9 is named Horizontal Tab with
standard notation ^I)

similar other pairs i noticed are Return and Ctrl+m (which is ascii
13; ^M).

i might be wrong though.

Reference:
http://xahlee.org/elisp/Character-Type.html

quote: «
 Control characters may be represented using yet another read syntax.
This consists of a question mark followed by a backslash, caret, and
the corresponding non-control character, in either upper or lower
case. For example, both `?\^I' and `?\^i' are valid read syntax for
the character C-i, the character whose value is 9.

Instead of the `^', you can use “C-”; thus, `?\C-i' is equivalent to `?
\^I' and to `?\^i':

     ?\^I ⇒ 9     ?\C-I ⇒ 9
»

  Xah
∑ http://xahlee.org/

reply via email to

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