Fix featurep! in private submodules

You'll have to use the full form to use featurep! in the private module
root, but now the short form will work in the nested submodules.
This commit is contained in:
Henrik Lissner 2018-02-15 03:36:28 -05:00
parent 800f8c4739
commit 0e6540fb8f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -232,10 +232,13 @@ This aggressively reloads core autoload files."
(defun doom-module-from-path (path)
"Get module cons cell (MODULE . SUBMODULE) for PATH, if possible."
(when-let* ((path (file-relative-name (file-truename path) (file-truename doom-modules-dir))))
(let ((segments (split-string path "/")))
(cons (intern (concat ":" (car segments)))
(intern (cadr segments))))))
(save-match-data
(setq path (file-truename path))
(when (string-match "/modules/\\([^/]+\\)/\\([^/]+\\)/.*$" path)
(when-let* ((module (match-string 1 path))
(submodule (match-string 2 path)))
(cons (intern (concat ":" module))
(intern submodule))))))
(defun doom-module-paths (&optional append-file)
"Returns a list of absolute file paths to activated modules, with APPEND-FILE