refactor: change doom-module-list signature

Used to return the hash-table `doom-modules` (if not all-p), but I've
changed it to return a list of cons cells (:CATEGORY . MODULE),
representing all enabled modules, in the order they were enabled.

The purpose of this change is to prepare for a change in the structure
of doom-modules, and how Doom stores its module metadata.
This commit is contained in:
Henrik Lissner 2022-09-12 22:50:25 +02:00
parent 775ee2f04a
commit 0c918f3b2d
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
5 changed files with 26 additions and 24 deletions

View file

@ -300,15 +300,15 @@ ready to be pasted in a bug report on github."
if (eq type 'theme-value)
collect var)))
(modules
,@(or (cl-loop with cat = nil
for key being the hash-keys of doom-modules
if (or (not cat)
(not (eq cat (car key))))
do (setq cat (car key))
and collect cat
,@(or (cl-loop with lastcat = nil
for (cat . mod) in (cddr (doom-module-list))
if (or (not lastcat)
(not (eq lastcat cat)))
do (setq lastcat cat)
and collect lastcat
collect
(let* ((flags (doom-module-get cat (cdr key) :flags))
(path (doom-module-get cat (cdr key) :path))
(let* ((flags (doom-module-get lastcat mod :flags))
(path (doom-module-get lastcat mod :path))
(module
(append
(cond ((null path)
@ -316,8 +316,8 @@ ready to be pasted in a bug report on github."
((not (file-in-directory-p path doom-modules-dir))
(list '&user)))
(if flags
`(,(cdr key) ,@flags)
(list (cdr key))))))
`(,mod ,@flags)
(list mod)))))
(if (= (length module) 1)
(car module)
module)))