fix(lib): void-function editorconfig--default-indent-size-function

There are two editorconfig libraries. One built into 30+ and one on
MELPA. Same name, different APIs. If the MELPA one is installed through,
say, your OS package manager, then the detection heuristic in
`doom/set-indent-width` could get confused which library is which.

Fix: #8423
This commit is contained in:
Henrik Lissner
2025-06-30 23:37:51 +02:00
parent 0fe36e12a9
commit 7d69c5f7df

View File

@ -373,7 +373,8 @@ editorconfig or dtrt-indent installed."
;; A built-in `editorconfig' package was added in Emacs 30.x, but
;; with a different API. Since it's built in, prefer it over the
;; upstream one, but we still need to adapt:
(require 'editorconfig nil t))
(if (require 'editorconfig nil t)
(fboundp #'editorconfig--default-indent-size-function)))
(pcase-dolist (`(,var . ,val) (editorconfig--default-indent-size-function width))
(set (make-local-variable var) val)))
((require 'editorconfig nil t)