When I bind a function to C-i. It seems that tab is bound to the function.
Why does it happens? Is it recognized same key in Emacs?
They happen to be linked in the default setup, but it doesn't have to be this way:
(keyboard-translate ?\C-i ?\C-j)
Now C-i will do a newline, while tab will still indent.
Hitting TAB on a text terminal sends the C-i code (which is the ascii char named TAB) to the application, so under a tty C-i and TAB are usually indistinguishable.
Emacs by default preserves this equivalence in GUI environments by mapping the tab event to C-i when there's no binding for tab (this is done in function-key-map). So most packages should bind their commands to the TAB char (i.e. C-i) rather than to the tab event, so that it works equally well under a tty or under a GUI. But if you want to distinguish the two, it's very easy: just bind the command you want to the tab event and the mapping from tab to C-i won't happen any more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With