editorconfig / editorconfig-emacs

EditorConfig plugin for Emacs
https://editorconfig.org
GNU General Public License v3.0
748 stars 107 forks source link

Support for nxml-mode indent #273

Closed steinarb closed 2 years ago

steinarb commented 2 years ago

It would be nice of nxml-mode indent could be controlled/overruled from an .editorconfig file.

10sr commented 2 years ago

It seems nxml-mode has already been supported: https://github.com/editorconfig/editorconfig-emacs/blob/541298aa616c344aa6a90f08205ae1041f6f016e/editorconfig.el#L238

Are you facing some trouble with this?

steinarb commented 2 years ago

This on emacs 27.1 on debian stable (11.5 "bullseye").

It turned to be my own mistake, when I looked at the mode line I saw that EditorConfig wasn't activated until I had loaded it manually and with EditorConfig activated in the mode line when the pom.xml was loaded, then it indented with 4 (from indent_size in the .editorconfig) instead of 2 (which is the nxml default).

when I added the following from the editorconfig-emacs README to my .emacs, then editorconfig was loaded from the start, and indentation size in nxml was picked up from the .editorconfig file:

(when (locate-library "editorconfig")
  (editorconfig-mode 1))