all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* C-i and TAB
@ 2002-10-17  9:12 Boris H.
  0 siblings, 0 replies; 18+ messages in thread
From: Boris H. @ 2002-10-17  9:12 UTC (permalink / raw)


Hi,

my Emacs 21.1.1 reads C-i as TAB. I want to remove this binding to rebind 
C-i. I tried 

(global-unset-key "\C-i")

which had no effect.
How do I make Emacs read C-i as C-i only?

Boris

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

* C-i and tab
@ 2002-10-31 13:33 Boris H.
  2002-10-31 14:20 ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Boris H. @ 2002-10-31 13:33 UTC (permalink / raw)


Hi,

Emacs 21 reads C-i as Tab. How can I change this so I can remap C-i without 
affecting tab? I tried all sorts of global-set-key and -unset-key without 
luck.

Boris

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

* Re: C-i and tab
  2002-10-31 13:33 C-i and tab Boris H.
@ 2002-10-31 14:20 ` Eli Zaretskii
  0 siblings, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2002-10-31 14:20 UTC (permalink / raw)



On Thu, 31 Oct 2002, Boris H. wrote:

> Emacs 21 reads C-i as Tab. How can I change this so I can remap C-i without 
> affecting tab? I tried all sorts of global-set-key and -unset-key without 
> luck.

You could remap [tab] (the function key) to what C-i is mapped now, and 
then remap C-i to something else.  Note that this will not work on 
character terminals where the TAB key produces C-i, so Emacs cannot 
distinguish between them.

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

* Re: C-i and tab
       [not found] <mailman.1036074155.21234.help-gnu-emacs@gnu.org>
@ 2002-10-31 15:26 ` Boris H.
  2002-10-31 18:52   ` Eli Zaretskii
       [not found]   ` <mailman.1036095163.1063.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 18+ messages in thread
From: Boris H. @ 2002-10-31 15:26 UTC (permalink / raw)


Eli Zaretskii wrote:

> You could remap [tab] (the function key) to what C-i is mapped now, and
> then remap C-i to something else.  Note that this will not work on
> character terminals where the TAB key produces C-i, so Emacs cannot
> distinguish between them.

I've just tried it, but it doesn't work:

(global-set-key [(tab)] 'indent-for-tab-command)
(global-set-key [(control i)] 'ispell)

When I press C-h k C-i, Emacs tells me that TAB runs the command 
lisp-indent-line.

Boris

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

* Re: C-i and tab
  2002-10-31 15:26 ` C-i and tab Boris H.
@ 2002-10-31 18:52   ` Eli Zaretskii
       [not found]   ` <mailman.1036095163.1063.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2002-10-31 18:52 UTC (permalink / raw)


> From: "Boris H." <nosp@m.de>
> Newsgroups: gnu.emacs.help
> Date: Thu, 31 Oct 2002 16:26:57 +0100
> 
> Eli Zaretskii wrote:
> 
> > You could remap [tab] (the function key) to what C-i is mapped now, and
> > then remap C-i to something else.  Note that this will not work on
> > character terminals where the TAB key produces C-i, so Emacs cannot
> > distinguish between them.
> 
> I've just tried it, but it doesn't work:
> 
> (global-set-key [(tab)] 'indent-for-tab-command)

Try this:

 (define-key function-key-map [tab] 'indent-for-tab-command)

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

* Re: C-i and tab
       [not found]   ` <mailman.1036095163.1063.help-gnu-emacs@gnu.org>
@ 2002-10-31 21:25     ` Stefan Monnier <foo@acm.com>
  2002-11-04  9:57     ` Boris H.
  1 sibling, 0 replies; 18+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-10-31 21:25 UTC (permalink / raw)


>>>>> "Eli" == Eli Zaretskii <eliz@is.elta.co.il> writes:
>  (define-key function-key-map [tab] 'indent-for-tab-command)

You mean (define-key global-map [tab] 'indent-for-tab-command) ?


        Stefan

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

* Re: C-i and tab
       [not found]   ` <mailman.1036095163.1063.help-gnu-emacs@gnu.org>
  2002-10-31 21:25     ` Stefan Monnier <foo@acm.com>
@ 2002-11-04  9:57     ` Boris H.
  2002-11-07  7:48       ` maierh
  1 sibling, 1 reply; 18+ messages in thread
From: Boris H. @ 2002-11-04  9:57 UTC (permalink / raw)


Eli Zaretskii wrote:
> Try this:
> 
>  (define-key function-key-map [tab] 'indent-for-tab-command)

It still does not work. Emacs keeps reading C-i as tab. Is there no way to 
change this?
The same is true for C-m and ret.

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

* Re: C-i and tab
  2002-11-04  9:57     ` Boris H.
@ 2002-11-07  7:48       ` maierh
  0 siblings, 0 replies; 18+ messages in thread
From: maierh @ 2002-11-07  7:48 UTC (permalink / raw)


"Boris H." <nosp@m.de> writes:

> It still does not work. Emacs keeps reading C-i as tab. Is there no
> way to change this?  The same is true for C-m and ret.

What's wrong and why do you want to change that? C-i is tab and C-m is
RET.  

Harald

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

* C-i and TAB
@ 2013-02-07 15:21 Ivan Kanis
  2013-02-07 16:00 ` Andreas Schwab
  2013-02-07 16:44 ` Stefan Monnier
  0 siblings, 2 replies; 18+ messages in thread
From: Ivan Kanis @ 2013-02-07 15:21 UTC (permalink / raw)
  To: Emacs Development List

How come Emacs for X can't distinguish between C-i and TAB? I understand
why that happens on a terminal, but on X it should be possible...
-- 
Ivan Kanis
http://ivan.kanis.fr

Si jeunesse savait, si vieillesse pouvait.
    -- Henri Estienne



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

* Re: C-i and TAB
  2013-02-07 15:21 C-i and TAB Ivan Kanis
@ 2013-02-07 16:00 ` Andreas Schwab
  2013-02-07 16:44 ` Stefan Monnier
  1 sibling, 0 replies; 18+ messages in thread
From: Andreas Schwab @ 2013-02-07 16:00 UTC (permalink / raw)
  To: Ivan Kanis; +Cc: Emacs Development List

Ivan Kanis <banana@kanis.fr> writes:

> How come Emacs for X can't distinguish between C-i and TAB?

Because C-i and TAB are just two names for the same thing.

> I understand why that happens on a terminal, but on X it should be
> possible...

Try <tab> instead.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: C-i and TAB
  2013-02-07 15:21 C-i and TAB Ivan Kanis
  2013-02-07 16:00 ` Andreas Schwab
@ 2013-02-07 16:44 ` Stefan Monnier
  2013-02-07 17:21   ` Ivan Kanis
  1 sibling, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2013-02-07 16:44 UTC (permalink / raw)
  To: Ivan Kanis; +Cc: Emacs Development List

> How come Emacs for X can't distinguish between C-i and TAB? I understand
> why that happens on a terminal, but on X it should be possible...

Emacs definitely distinguished between the two.
But it has a function-key-map entry that turns `tab' (the event
generated by your TAB key) into a C-i when there's no binding for `tab'.


        Stefan



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

* Re: C-i and TAB
  2013-02-07 16:44 ` Stefan Monnier
@ 2013-02-07 17:21   ` Ivan Kanis
  2013-02-07 18:19     ` Stefan Monnier
  0 siblings, 1 reply; 18+ messages in thread
From: Ivan Kanis @ 2013-02-07 17:21 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Ivan Kanis, Emacs Development List

>> How come Emacs for X can't distinguish between C-i and TAB? I understand
>> why that happens on a terminal, but on X it should be possible...
>
> Emacs definitely distinguished between the two.
> But it has a function-key-map entry that turns `tab' (the event
> generated by your TAB key) into a C-i when there's no binding for `tab'.

Not in trunk:

emacs -Q

(global-set-key (kbd "C-i") 'foo)
(global-set-key (kbd "TAB") 'bar)

TAB -> Symbol's function definition is void: bar
C-i -> Symbol's function definition is void: bar



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

* Re: C-i and TAB
  2013-02-07 17:21   ` Ivan Kanis
@ 2013-02-07 18:19     ` Stefan Monnier
  2013-02-07 18:23       ` Ivan Kanis
  2013-02-07 19:47       ` Drew Adams
  0 siblings, 2 replies; 18+ messages in thread
From: Stefan Monnier @ 2013-02-07 18:19 UTC (permalink / raw)
  To: Ivan Kanis; +Cc: Ivan Kanis, Emacs Development List

> (global-set-key (kbd "C-i") 'foo)
> (global-set-key (kbd "TAB") 'bar)

`kbd's syntax defines TAB as equivalent to C-i, so the above two
instructions bind the same key.

Try

(global-set-key [?\C-i] 'foo)
(global-set-key [tab] 'bar)


        Stefan



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

* Re: C-i and TAB
  2013-02-07 18:19     ` Stefan Monnier
@ 2013-02-07 18:23       ` Ivan Kanis
  2013-02-07 19:47       ` Drew Adams
  1 sibling, 0 replies; 18+ messages in thread
From: Ivan Kanis @ 2013-02-07 18:23 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs Development List

>> (global-set-key (kbd "C-i") 'foo)
>> (global-set-key (kbd "TAB") 'bar)
>
> `kbd's syntax defines TAB as equivalent to C-i, so the above two
> instructions bind the same key.
>
> Try
>
> (global-set-key [?\C-i] 'foo)
> (global-set-key [tab] 'bar)

Great! Thank you.




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

* RE: C-i and TAB
  2013-02-07 18:19     ` Stefan Monnier
  2013-02-07 18:23       ` Ivan Kanis
@ 2013-02-07 19:47       ` Drew Adams
  2013-02-07 23:56         ` Xue Fuqiao
  1 sibling, 1 reply; 18+ messages in thread
From: Drew Adams @ 2013-02-07 19:47 UTC (permalink / raw)
  To: 'Stefan Monnier', 'Ivan Kanis'
  Cc: 'Ivan Kanis', 'Emacs Development List'

> > (global-set-key (kbd "C-i") 'foo)
> > (global-set-key (kbd "TAB") 'bar)
> 
> `kbd's syntax defines TAB as equivalent to C-i, so the above two
> instructions bind the same key.
> 
> Try
> (global-set-key [?\C-i] 'foo)
> (global-set-key [tab] 'bar)


Or just this, no?

(global-set-key (kbd "C-i")   'foo)
(global-set-key (kbd "<tab>") 'bar)




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

* Re: C-i and TAB
  2013-02-07 19:47       ` Drew Adams
@ 2013-02-07 23:56         ` Xue Fuqiao
  2013-02-08  1:35           ` Ivan Kanis
  2013-02-08  2:46           ` Drew Adams
  0 siblings, 2 replies; 18+ messages in thread
From: Xue Fuqiao @ 2013-02-07 23:56 UTC (permalink / raw)
  To: Drew Adams
  Cc: 'Emacs Development List', 'Stefan Monnier',
	'Ivan Kanis', 'Ivan Kanis'

On Thu, 7 Feb 2013 11:47:34 -0800
"Drew Adams" <drew.adams@oracle.com> wrote:

> > > (global-set-key (kbd "C-i") 'foo)
> > > (global-set-key (kbd "TAB") 'bar)
> > 
> > `kbd's syntax defines TAB as equivalent to C-i, so the above two
> > instructions bind the same key.
> > 
> > Try
> > (global-set-key [?\C-i] 'foo)
> > (global-set-key [tab] 'bar)
> 
> 
> Or just this, no?
> 
> (global-set-key (kbd "C-i")   'foo)
> (global-set-key (kbd "<tab>") 'bar)

Their effect should be the same.

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



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

* Re: C-i and TAB
  2013-02-07 23:56         ` Xue Fuqiao
@ 2013-02-08  1:35           ` Ivan Kanis
  2013-02-08  2:46           ` Drew Adams
  1 sibling, 0 replies; 18+ messages in thread
From: Ivan Kanis @ 2013-02-08  1:35 UTC (permalink / raw)
  To: Xue Fuqiao
  Cc: 'Stefan Monnier', Drew Adams,
	'Emacs Development List'

> On Thu, 7 Feb 2013 11:47:34 -0800
> "Drew Adams" <drew.adams@oracle.com> wrote:
>
>> > > (global-set-key (kbd "C-i") 'foo)
>> > > (global-set-key (kbd "TAB") 'bar)
>> >
>> > `kbd's syntax defines TAB as equivalent to C-i, so the above two
>> > instructions bind the same key.
>> >
>> > Try
>> > (global-set-key [?\C-i] 'foo)
>> > (global-set-key [tab] 'bar)
>>
>>
>> Or just this, no?
>>
>> (global-set-key (kbd "C-i")   'foo)
>> (global-set-key (kbd "<tab>") 'bar)
>
> Their effect should be the same.
>

I like Andrew's best. I have never been a fan of the "native" keybinding
representation.




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

* RE: C-i and TAB
  2013-02-07 23:56         ` Xue Fuqiao
  2013-02-08  1:35           ` Ivan Kanis
@ 2013-02-08  2:46           ` Drew Adams
  1 sibling, 0 replies; 18+ messages in thread
From: Drew Adams @ 2013-02-08  2:46 UTC (permalink / raw)
  To: 'Xue Fuqiao'
  Cc: 'Emacs Development List', 'Stefan Monnier',
	'Ivan Kanis', 'Ivan Kanis'

> > > > (global-set-key (kbd "C-i") 'foo)
> > > > (global-set-key (kbd "TAB") 'bar)
> > > 
> > > Try
> > > (global-set-key [?\C-i] 'foo)
> > > (global-set-key [tab] 'bar)
> > 
> > Or just this, no?
> > (global-set-key (kbd "C-i")   'foo)
> > (global-set-key (kbd "<tab>") 'bar)
> 
> Their effect should be the same.

That was the point.
You can use `kbd' as originally attempted.
You just need to know the external representation <tab>. 




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

end of thread, other threads:[~2013-02-08  2:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1036074155.21234.help-gnu-emacs@gnu.org>
2002-10-31 15:26 ` C-i and tab Boris H.
2002-10-31 18:52   ` Eli Zaretskii
     [not found]   ` <mailman.1036095163.1063.help-gnu-emacs@gnu.org>
2002-10-31 21:25     ` Stefan Monnier <foo@acm.com>
2002-11-04  9:57     ` Boris H.
2002-11-07  7:48       ` maierh
2013-02-07 15:21 C-i and TAB Ivan Kanis
2013-02-07 16:00 ` Andreas Schwab
2013-02-07 16:44 ` Stefan Monnier
2013-02-07 17:21   ` Ivan Kanis
2013-02-07 18:19     ` Stefan Monnier
2013-02-07 18:23       ` Ivan Kanis
2013-02-07 19:47       ` Drew Adams
2013-02-07 23:56         ` Xue Fuqiao
2013-02-08  1:35           ` Ivan Kanis
2013-02-08  2:46           ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2002-10-31 13:33 C-i and tab Boris H.
2002-10-31 14:20 ` Eli Zaretskii
2002-10-17  9:12 C-i and TAB Boris H.

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.