From 0e6540fb8f9930fa1a452add326e00bcd056fe9a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 15 Feb 2018 03:36:28 -0500 Subject: [PATCH] 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. --- core/core-packages.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/core-packages.el b/core/core-packages.el index e911ff247..55d665763 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -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