diff --git a/core/core-editor.el b/core/core-editor.el index 67ad482d2..aa8130320 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -171,17 +171,6 @@ with functions that require it (like modeline segments)." ;; Handles whitespace (tabs/spaces) settings externally. This way projects can ;; specify their own formatting rules. (def-package! editorconfig - :init - (def-setting! :editorconfig (action value) - ":add or :remove an entry in `editorconfig-indentation-alist'." - (cond ((eq action :add) - `(push ,value editorconfig-indentation-alist)) - ((eq action :remove) - `(setq editorconfig-indentation-alist - (assq-delete-all ,value editorconfig-indentation-alist))) - (t (error "%s is an invalid action for :editorconfig" - action)))) - :config (add-hook 'doom-init-hook #'editorconfig-mode) @@ -211,10 +200,12 @@ extension, try to guess one." (apply orig-fn args))) (advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection) - ;; 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) + ;; Editorconfig makes indentation too rigid in Lisp modes, so tell + ;; editorconfig to ignore indentation. I prefer dynamic indentation support + ;; built into Emacs. + (dolist (mode '(emacs-lisp-mode lisp-mode)) + (setq editorconfig-indentation-alist + (assq-delete-all mode editorconfig-indentation-alist))) (defvar whitespace-style) (defun doom|editorconfig-whitespace-mode-maybe (&rest _) diff --git a/modules/lang/javascript/config.el b/modules/lang/javascript/config.el index edc8909ce..4301063dc 100644 --- a/modules/lang/javascript/config.el +++ b/modules/lang/javascript/config.el @@ -15,8 +15,8 @@ (set! :electric 'js2-mode :chars '(?\} ?\) ?.)) (set! :jump 'js2-mode :xref-backend #'xref-js2-xref-backend) - ;; Conform switch-case indentation to editorconfig's config - (set! :editorconfig :add '(js2-mode js2-basic-offset js-switch-indent-offset)) + ;; Conform switch-case indentation to js2 normal indent + (defvaralias 'js-switch-indent-offset 'js2-basic-offset) (sp-with-modes '(js2-mode rjsx-mode) (sp-local-pair "/* " " */" :post-handlers '(("| " "SPC")))) diff --git a/modules/lang/lua/config.el b/modules/lang/lua/config.el index 7a9123342..fdc6ad623 100644 --- a/modules/lang/lua/config.el +++ b/modules/lang/lua/config.el @@ -29,8 +29,7 @@ (def-package! moonscript :mode ("\\.moon$" . moonscript-mode) - :config - (set! :editorconfig :add '(moonscript-mode moonscript-indent-offset))) + :config (defvaralias 'moonscript-indent-offset 'tab-width)) ;;