What is the relationship of Ci and tab in Emacs?

When I bind a function to Ci . The tab seems to be related to the function. Why is this happening? Does he know the same key in Emacs?

+6
source share
2 answers

They are related to the default installation, but it should not be like this:

 (keyboard-translate ?\Ci ?\Cj) 

Now Ci will do a new line, and tab indent.

+4
source

Enabling TAB on a text terminal sends Ci code to the application (which is an ascii char named TAB), so under tty Ci and TAB are usually indistinguishable. Emacs by default preserves this equivalence in GUI environments by mapping the tab event to Ci when there is no binding for tab (this is done in function-key-map ). Therefore, most packages should associate their commands with a TAB char (i.e. Ci ), and not with the tab event, so that it works equally well under tty or under the GUI. But if you want to distinguish between the two, it is very simple: just bind the command you want to the tab event, and the mapping from tab to Ci will no longer happen.

+3
source

Source: https://habr.com/ru/post/950233/


All Articles