refactor: use Doom utility function for indentation vars

This commit is contained in:
Kiana Sheibani 2026-02-14 18:34:49 -05:00
parent 5b065e68ef
commit b5504e4fdc
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -974,7 +974,6 @@ fold
:tools :tools
biblio biblio
debugger debugger
editorconfig
(eval +overlay) (eval +overlay)
(lookup +dictionary +docsets) (lookup +dictionary +docsets)
make make
@ -1464,6 +1463,25 @@ Corfu's posframe buffer shouldn't be numbered by =winum=:
(push " *corfu*" winum-ignored-buffers)) (push " *corfu*" winum-ignored-buffers))
#+end_src #+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 ** Eldoc
#+call: confpkg("Pkg: eldoc") #+call: confpkg("Pkg: eldoc")
@ -4533,11 +4551,8 @@ The Agda integration with Markdown specifically requires some changes to the pol
*** Indentation *** 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 #+begin_src emacs-lisp
(after! editorconfig (set-editorconfig-indent-var! 'nix-ts-mode 'nix-ts-mode-indent-offset)
(push '(nix-ts-mode nix-ts-mode-indent-offset) editorconfig-indentation-alist))
#+end_src #+end_src
** Python ** Python
@ -4556,6 +4571,12 @@ EditorConfig can't find this mode's indentation variables itself, so we'll have
:lang (qt +lsp +tree-sitter) :lang (qt +lsp +tree-sitter)
#+end_src #+end_src
*** Indentation
#+begin_src emacs-lisp
(set-editorconfig-indent-var! 'qml-ts-mode 'qml-ts-mode-indent-offset)
#+end_src
** Rust ** Rust
#+call: confpkg("Mode: Rust") #+call: confpkg("Mode: Rust")