fix(cli): autoloads: type error parsing autoloads

Prevent rare edge cases where FORM is an atom, causing `cadr` to throw a
type error. Might explain some cases of `doom sync` doing nothing after
'> Generating N init files...'.

Amend: c014950f6d
This commit is contained in:
Henrik Lissner
2025-09-03 23:13:59 +02:00
parent eb734f21e9
commit 26a5ad72e1

View File

@@ -60,7 +60,7 @@ hoist buggy forms into autoloads.")
;; HACK: Remove modifications to `auto-mode-alist' and
;; `interpreter-mode-alist' in *-ts-mode package. They are applied
;; twice and often overwrite user or module configuration.
((equal (list (car form) (cadr form)) '(when (treesit-available-p)))
((equal (list func (car (cdr-safe form))) '(when (treesit-available-p)))
(setf (nth 2 form)
(cl-loop for form in (nth 2 form)
if (or (not (eq (car-safe form) 'add-to-list))