More precisely, I would like TAB
to indent the current line when there are 0 or more whitespace characters between the start of line and the point and to advance to the next tab stop otherwise. I used to have this behavior 1 or 2 major versions ago, but I lost it in an upgrade (I'm currently using 27.2).
I tried customizing tab-always-indent
to nil
as defined in indent.el, but I think the programming mode is overriding this behavior (I primarily deal in curly-brace languages).
I use this behavior to create "columns" in my source. i.e.
private int able;
private boolean baker;
public int getAble() { return able; }
public boolean getBaker() { return baker; }
Turns out I needed to pay closer attention to the description when customizing tab-always-indent and customize c-tab-always-indent as:
Some programming language modes have their own variable to control this, e.g., 'c-tab-always-indent', and do not respect this variable.
C-h c <TAB>
andC-h v <tab-always-indent>
, both with your Emacs setup and when starting it without customizations (e.g.$ emacs -Q
)? What is the major-mode of the buffer?