summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/editorconfig.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/editorconfig.el b/lisp/editorconfig.el
index 931781007d9..870f6d32162 100644
--- a/lisp/editorconfig.el
+++ b/lisp/editorconfig.el
@@ -211,7 +211,7 @@ This hook will be run even when there are no matching sections in
(mustache-mode mustache-basic-offset)
(nasm-mode nasm-basic-offset)
(nginx-mode nginx-indent-level)
- (nxml-mode nxml-child-indent (nxml-attribute-indent . 2))
+ (nxml-mode . editorconfig--get-indentation-nxml-mode)
(objc-mode c-basic-offset)
(octave-mode octave-block-offset)
(perl-mode perl-indent-level)
@@ -266,7 +266,9 @@ This is a fallback used for those modes which don't set
`editorconfig-indent-size-vars'.
Each element should look like (MODE . SETTING) where SETTING
-should obey the same rules as `editorconfig-indent-size-vars'."
+should obey the same rules as `editorconfig-indent-size-vars',
+i.e. either a list of variable names or a function returning a list of (VAR . VAL)
+settings."
:type '(alist :key-type symbol
:value-type (choice function
(repeat
@@ -341,6 +343,11 @@ Make a message by passing ARGS to `format-message'."
(LaTeX-indent-level . ,size)
(LaTeX-item-indent . ,(- size))))
+(defun editorconfig--get-indentation-nxml-mode (size)
+ "Vars to set `nxml-mode' indent size to SIZE."
+ `((nxml-child-indent . ,size)
+ (nxml-attribute-indent . ,(* 2 size))))
+
(defun editorconfig--get-indentation-lisp-mode (size)
"Set indent size to SIZE for Lisp mode(s)."
(when (cond ((null editorconfig-lisp-use-default-indent) t)