refactor: prefer cl-lib over dash

This commit is contained in:
Kiana Sheibani 2026-02-14 19:02:57 -05:00
parent c17b5473d0
commit b70acaa3f6
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -2093,21 +2093,21 @@ Problem solved, right? Not quite. We can't just read the variable it returns, be
"Guess the indent offset of the current buffer based on
`editorconfig--get-indentation'."
(require 'editorconfig)
(require 'dash)
(let* ((indent-value 720720)
(alist (editorconfig--get-indentation nil (number-to-string indent-value))))
(--some (pcase it
;; Non-mode-specific variables - ignore
(`(tab-width . ,_) nil)
(`(evil-shift-width . ,_) nil)
(`(,var . ,val)
(cond ((zerop val) nil)
((= val indent-value) (symbol-value var))
((zerop (mod indent-value val))
(* (symbol-value var) (/ indent-value val)))
((zerop (mod val indent-value))
(/ (symbol-value var) (/ val indent-value))))))
alist)))
(cl-some (lambda (entry)
(pcase entry
;; Non-mode-specific variables - ignore
(`(tab-width . ,_) nil)
(`(evil-shift-width . ,_) nil)
(`(,var . ,val)
(cond ((zerop val) nil)
((= val indent-value) (symbol-value var))
((zerop (mod indent-value val))
(* (symbol-value var) (/ indent-value val)))
((zerop (mod val indent-value))
(/ (symbol-value var) (/ val indent-value)))))))
alist)))
(advice-add #'indent-bars--guess-spacing
:before-until #'~/guess-offset-from-editorconfig)