i desperately try to make my emacs xml (sgml?) mode indent with tabs instead of spaces. What i tried so far:
(defun my-xml-hook ()
(setq c-tab-always-indent t
tab-width 4
indent-tabs-mode t) ; use tabs for indentation
(setq indent-line-function 'insert-tab)
)
(add-hook 'xml-mode-hook 'my-xml-hook)
(defun local-sgml-mode-hook
(setq fill-column 70
indent-tabs-mode t
next-line-add-newlines nil
sgml-indent-data t)
(auto-fill-mode t)
(setq indent-line-function 'insert-tab)
)
(add-hook 'psgml-mode-hook '(lambda () (local-psgml-mode-hook)))
Nothing works though, indentation will still happen with 2 spaces (emacs23 and emacs24) when editing *.xml files.
Note that i also have
(setq indent-tabs-mode nil)
in my .emacs file, but the hook should be called afterwards so this should be overridden.
How can i force emacs to indent with tabs in *.xml files? Why are my hooks not working?
c-tab-always-indent
is for C/C++/Java. Since xml doesn't inherit them, I don't think it will work – abo-abotab-always-indent
var that you should use – abo-abo