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.
source
share