Emacs: Set tab-width to 4 in XML

master
Pierre Neidhardt 2017-06-23 14:41:22 +01:00
parent 9f9370d196
commit 2ac066840b
2 changed files with 8 additions and 0 deletions

View File

@ -278,6 +278,10 @@ e-mail."
;; (toggle-truncate-lines) ; This seems to slow down Emacs.
(turn-off-auto-fill))
(add-hook 'sgml-mode-hook 'sgml-setup)
(with-eval-after-load 'nxml-mode
(defvaralias 'nxml-child-indent 'tab-width))
;;; Because XML is hard to read.
(add-hook 'nxml-mode-hook 'turn-on-tab-width-to-4)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Finalization

View File

@ -441,6 +441,10 @@ This does not interfere with `subword-mode'."
"Unconditionally turn off Linum mode."
(linum-mode 0))
(defun turn-on-tab-width-to-4 ()
"Unconditionally set tab width to 4."
(setq tab-width 4))
(defun turn-on-tab-width-to-8 ()
"Unconditionally set tab width to 8."
(setq tab-width 8))