Fix editorconfig indent-policing in Lisp modes

Editorconfig in Lisp enforces lisp-indent-offset too strictly, ruining
its adaptive indentation. We don't want to disable it complete in those
modes however. In all other respects (controlling spaces vs tabs,
charset, max_line_length, etc) editorconfig is great.
This commit is contained in:
Henrik Lissner 2017-06-15 14:37:16 +02:00
parent cf7779138a
commit 853ad98ae9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 5 additions and 3 deletions

View file

@ -152,6 +152,11 @@ fundamental-mode) for performance sake."
:config :config
(add-hook 'doom-init-hook #'editorconfig-mode) (add-hook 'doom-init-hook #'editorconfig-mode)
;; Editorconfig makes indentation weird in Lisp modes, so we disable it. It
;; still applies other project settings (e.g. tabs vs spaces) though.
(set! :editorconfig :remove 'emacs-lisp-mode)
(set! :editorconfig :remove 'lisp-mode)
(defun doom|editorconfig-whitespace-mode-maybe (&rest _) (defun doom|editorconfig-whitespace-mode-maybe (&rest _)
"Show whitespace-mode when file uses TABS (ew)." "Show whitespace-mode when file uses TABS (ew)."
(if indent-tabs-mode (whitespace-mode +1))) (if indent-tabs-mode (whitespace-mode +1)))

View file

@ -16,9 +16,6 @@
("add-hook" "remove-hook") ("add-hook" "remove-hook")
("add-hook!" "remove-hook!"))) ("add-hook!" "remove-hook!")))
;; Don't affect lisp indentation (only `tab-width')
(set! :editorconfig :remove 'emacs-lisp-mode)
(defun +emacs-lisp|hook () (defun +emacs-lisp|hook ()
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t) (add-hook 'before-save-hook #'delete-trailing-whitespace nil t)