From 853ad98ae9e77779acd2622f042b99bd96b07b1c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 15 Jun 2017 14:37:16 +0200 Subject: [PATCH] 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. --- core/core-editor.el | 5 +++++ modules/lang/emacs-lisp/config.el | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index 2a274cbc6..1cac1f8f1 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -152,6 +152,11 @@ fundamental-mode) for performance sake." :config (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 _) "Show whitespace-mode when file uses TABS (ew)." (if indent-tabs-mode (whitespace-mode +1))) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index 3dda79a8e..b6453040e 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -16,9 +16,6 @@ ("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 () (add-hook 'before-save-hook #'delete-trailing-whitespace nil t)