unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ messages in thread

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

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).