Книга: Learning GNU Emacs, 3rd Edition

7.1.5 Tabs and Spaces

7.1.5 Tabs and Spaces

Another characteristic of Emacs's default behavior is the fact that it may insert a combination of tabs and spaces when you press Tab. Try to erase a few "tabs" and you'll see that often it isn't one character, but the equivalent number of spaces or a combination of tabs and spaces. Of course, this largely depends on the tab stops compared to setting of the tab-width variable. If you set tab stops that are multiples of six while you have a tab-width of 4 or 8, Emacs is going to have to use a combination of tabs and spaces to achieve the desired tab stops.

If you want Emacs to insert spaces for indentation rather than tab characters, add this line to your .emacs file:

(setq-default indent-tabs-mode nil)

With this setting, Emacs inserts only spaces when you press Tab. Pressing C-q Tab instead inserts a literal tab character. It's safe to say you won't enter tab characters accidentally with this setting.

Оглавление книги


Генерация: 1.258. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз