(c-)tab-always-indent
controls what hitting the TAB key does, not what is inserted.
Setting indent-line-function
to insert-tab
will make you lose the smart indentation of the mode.
If you are using a modern emacs, chances are you are using nxml-mode instead of xml-mode. In that case nxml-mode-hook
should be the one where you should do (setq indent-tabs-mode t)
.
If you are using default sgml mode, sgml-mode-hook
should be the one where you should do (setq indent-tabs-mode t)
should be done (in your snippet you are using psgml-mode-hook
)
(and tab-always-indent and indent-line-function could be leave in their default states)
EDIT
To summarize conversation below: variable nxml-child-indent
should not be less than tab-width
.
(and since default emacs values for those variables are 2 and 8, imho configuring emacs to indent XML using tabs in emacs is harder than it should be)