What is the difference between indent-tabs-mode
and tab-always-indent
?
1 Answer
You can read the help for any variable by typing C-h v
which runs the command describe-function
.
tab-always-indent
adjusts the behavior of the TAB key. As the documentation says:
Controls the operation of the TAB key.
If t, hitting TAB always just indents the current line.
If nil, hitting TAB indents the current line if point is at the left margin
or in the line's indentation, otherwise it inserts a "real" TAB character.
If complete, TAB first tries to indent the current line, and if the line
was already indented, then try to complete the thing at point.
Meanwhile indent-tabs-mode
controls what character(s) to insert into the file when indenting a line:
Indentation can insert tabs if this is non-nil.
This is the most basic way you can choose between spaces or tabs for indentation.
-
To change
indent-tabs-mode
, there is the possibilities to usesetq-local
,setq-default
orsetq
. I thinksetq-default
only changes the behaviour for major modes where the variable has not been set.– DilnaCommented Jun 12, 2022 at 20:50 -
1That is a separate question, unrelated to
indent-tabs-mode
. You should ask it separately.– db48xCommented Jun 12, 2022 at 23:45
indent-tabs-mode
andtab-always-indent
? If so, can you be specific about what it is that you don't understand about the difference?