refactor: rethink doom-module-*-path functions

- Rename doom-module-path -> doom-module-expand-path, to better reflect
  its purpose.
- Optimize doom-module-locate-path to try caches and
  locate-file-internal, before looping through doom-modules-dirs.
- Rely on file-name-concat to join paths, rather than string
  concatenation. file-name-concat is more robust for the purpose and
  has lower overhead than expand-file-name.
This commit is contained in:
Henrik Lissner 2022-09-12 22:41:09 +02:00
parent a67b212b99
commit 775ee2f04a
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
4 changed files with 28 additions and 26 deletions

View file

@ -466,7 +466,7 @@ ones."
(let (doom-packages)
(doom--read-packages private-packages nil 'noerror))
(cl-loop for key being the hash-keys of doom-modules
for path = (doom-module-path (car key) (cdr key) packages-file)
for path = (doom-module-expand-path (car key) (cdr key) packages-file)
for doom--current-module = key
for doom--current-flags = (doom-module-get (car key) (cdr key) :flags)
do (doom--read-packages path nil 'noerror)))