From b5504e4fdc7d9acc79014b15ad2ffae1a4ea6af8 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Sat, 14 Feb 2026 18:34:49 -0500 Subject: [PATCH] refactor: use Doom utility function for indentation vars --- config.org | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/config.org b/config.org index a8bffe5..4485c18 100644 --- a/config.org +++ b/config.org @@ -974,7 +974,6 @@ fold :tools biblio debugger -editorconfig (eval +overlay) (lookup +dictionary +docsets) make @@ -1464,6 +1463,25 @@ Corfu's posframe buffer shouldn't be numbered by =winum=: (push " *corfu*" winum-ignored-buffers)) #+end_src +** EditorConfig + +#+call: confpkg("Pkg: editorconfig") + +#+begin_src emacs-lisp :noweb-ref doom-module +:tools editorconfig +#+end_src + +The convenience function ~set-editorconfig-indent-var!~ provided by Doom is just wrong. Here's a patch. + +#+begin_src emacs-lisp +(defpatch! (symbol-function #'set-editorconfig-indent-var!) + (defun set-editorconfig-indent-var!) (mode &rest vars) + "Add (MODE VARS...) to `editorconfig-indentation-alist'." + (after! editorconfig + (nconc editorconfig-indentation-alist + (el-patch-wrap 1 (list (cons mode vars)))))) +#+end_src + ** Eldoc #+call: confpkg("Pkg: eldoc") @@ -4533,11 +4551,8 @@ The Agda integration with Markdown specifically requires some changes to the pol *** Indentation -EditorConfig can't find this mode's indentation variables itself, so we'll have to tell it where they are. - #+begin_src emacs-lisp -(after! editorconfig - (push '(nix-ts-mode nix-ts-mode-indent-offset) editorconfig-indentation-alist)) +(set-editorconfig-indent-var! 'nix-ts-mode 'nix-ts-mode-indent-offset) #+end_src ** Python @@ -4556,6 +4571,12 @@ EditorConfig can't find this mode's indentation variables itself, so we'll have :lang (qt +lsp +tree-sitter) #+end_src +*** Indentation + +#+begin_src emacs-lisp +(set-editorconfig-indent-var! 'qml-ts-mode 'qml-ts-mode-indent-offset) +#+end_src + ** Rust #+call: confpkg("Mode: Rust")