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 "Guess the indent offset of the current buffer based on
`editorconfig--get-indentation'." `editorconfig--get-indentation'."
(require 'editorconfig) (require 'editorconfig)
(require 'dash)
(let* ((indent-value 720720) (let* ((indent-value 720720)
(alist (editorconfig--get-indentation nil (number-to-string indent-value)))) (alist (editorconfig--get-indentation nil (number-to-string indent-value))))
(--some (pcase it (cl-some (lambda (entry)
;; Non-mode-specific variables - ignore (pcase entry
(`(tab-width . ,_) nil) ;; Non-mode-specific variables - ignore
(`(evil-shift-width . ,_) nil) (`(tab-width . ,_) nil)
(`(,var . ,val) (`(evil-shift-width . ,_) nil)
(cond ((zerop val) nil) (`(,var . ,val)
((= val indent-value) (symbol-value var)) (cond ((zerop val) nil)
((zerop (mod indent-value val)) ((= val indent-value) (symbol-value var))
(* (symbol-value var) (/ indent-value val))) ((zerop (mod indent-value val))
((zerop (mod val indent-value)) (* (symbol-value var) (/ indent-value val)))
(/ (symbol-value var) (/ val indent-value)))))) ((zerop (mod val indent-value))
alist))) (/ (symbol-value var) (/ val indent-value)))))))
alist)))
(advice-add #'indent-bars--guess-spacing (advice-add #'indent-bars--guess-spacing
:before-until #'~/guess-offset-from-editorconfig) :before-until #'~/guess-offset-from-editorconfig)