This answer says how to make AUCTeX use tabs for leading indentation. However, it doesn't work for me and I don't understand why it doesn't.
After adding the code to my init file, LaTeX-mode just stopped indenting altogether.
I suspected that's because I customized variable and removed the LaTeX-mode- and indentation-related lines
'(LaTeX-indent-level 4)
'(LaTeX-item-indent 0)
'(TeX-brace-indent-level 4)
'(indent-tabs-mode t)
from the block
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(LaTeX-indent-level 4)
'(LaTeX-item-indent 0)
'(TeX-brace-indent-level 4)
'(indent-tabs-mode t)
'(org-agenda-files
(quote
(<I censored the strings in here.>)))
'(org-file-apps
(quote
((auto-mode . emacs)
("\\.mm\\'" . default)
("\\.x?html?\\'" . default)
("\\.pdf\\'" . "evince %s"))))
'(safe-local-variable-values (quote ((TeX-master . t))))
'(show-paren-mode t)
'(tool-bar-mode nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
in my init file after backing ~/.emacs.d
up as the comments say I'm not supposed to modify that block by hand. LaTeX mode still didn't indent (at all), so I had to remove the code I got from the linked answer and go back to indentation via spaces.
How do I get indentation via tabs working?
Update
After removing the customization with Andrew Swann's help and adding the code stated in the linked answer back to my init file, AUCTeX still doesn't use tabs for indentation. Or rather: It doesn't seem to indent anything. I tried setting LaTeX-indent-level
to 4 and LaTeX-item-indent
to 0 and even setting LaTeX-item-indent
to 4, too. It still didn't indent.
When I hit Tab, however, it actually enters a tab character.
M-x customize
orM-x customize-variable
.customize
deletes those lines from the init file. That's why I tried simply deleting the lines to see whether it worked would I be able to reset those variables properly.