mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08:00
fix(cli): remove *-ts-mode {interpreter,auto}-mode-alist entries
While generating the autoloads for the current profile (at `doom sync`), remove any `add-to-list` forms modifying `interpreter-mode-alist` or `auto-mode-alist` in autoloaded `(when (treesit-available-p) ...)` blocks. We want to fully rely on `major-mode-remap-defaults`.
This commit is contained in:
parent
87e4eb0e33
commit
c014950f6d
1 changed files with 10 additions and 0 deletions
|
|
@ -57,6 +57,16 @@ hoist buggy forms into autoloads.")
|
|||
(let ((func (car-safe form)))
|
||||
(cond ((memq func '(provide custom-autoload register-definition-prefixes))
|
||||
nil)
|
||||
;; 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)))
|
||||
(setf (nth 2 form)
|
||||
(cl-loop for form in (nth 2 form)
|
||||
if (or (not (eq (car-safe form) 'add-to-list))
|
||||
(not (memq (nth 1 form) '(auto-mode-alist interpreter-mode-alist))))
|
||||
collect form))
|
||||
form)
|
||||
((and (eq func 'add-to-list)
|
||||
(memq (doom-unquote (cadr form))
|
||||
doom-autoloads-cached-vars))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue