Does emacs always insert (and backspace) 4 spaces?

I thought I did it, but now sometimes emacs will go and insert a tab with 8 characters or a tab with a 6 or 5 character.

Perhaps this is caused by the document (this happened in a large text file that contains many different tab intervals, although this is mainly an increase of 4 characters or regular tabs).

(setq-default indent-tabs-mode 0)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)

The above code is from my init.el, which makes me wonder why it sometimes fails and inserts 6 characters.

+3
source share
1 answer

, , indent-line-function ( ). , , - , , , , , , tab-stop-list.

:
http://www.emacswiki.org/emacs/CategoryIndentation

, .

ruler-mode ruler-mode-show-tab-stops, .

+1

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


All Articles