mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-01-04 08:11:44 -08:00
fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.
This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd7, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.
Other notable changes:
- Changes the data structure for module data caches from a list to a
vector. Uses less memory and permits faster lookups. Also adds two
depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
loading doom-*.el.
Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd7
This commit is contained in:
parent
772f9f26d9
commit
5a5195b84d
9 changed files with 250 additions and 178 deletions
|
|
@ -306,7 +306,7 @@ ready to be pasted in a bug report on github."
|
|||
collect var)))
|
||||
(modules
|
||||
,@(or (cl-loop with lastcat = nil
|
||||
for (cat . mod) in (cddr (doom-module-list))
|
||||
for (cat . mod) in (seq-filter #'cdr (doom-module-list))
|
||||
if (or (not lastcat)
|
||||
(not (eq lastcat cat)))
|
||||
do (setq lastcat cat)
|
||||
|
|
|
|||
|
|
@ -154,8 +154,7 @@ each package."
|
|||
(if (listp m)
|
||||
(format "%s %s" (car m) (cdr m))
|
||||
(format "%s" m)))
|
||||
(append '(:user :core)
|
||||
(delete-dups (mapcar #'car modules))
|
||||
(append (delete-dups (mapcar #'car modules))
|
||||
modules)))
|
||||
nil t nil nil))
|
||||
(module (split-string module " " t)))
|
||||
|
|
@ -173,8 +172,7 @@ each package."
|
|||
(if module
|
||||
(list (cons category module))
|
||||
(cl-remove-if-not (lambda (m) (eq (car m) category))
|
||||
(append '((:core) (:user))
|
||||
(doom-module-list 'all))))))
|
||||
(doom-module-list 'all)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/bump-package (package)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue