fix(org): doom-module links opening private modules

A doom-module: link should only refer to built-in modules, not
user-provided ones in $DOOMDIR/modules.
This commit is contained in:
Henrik Lissner 2021-08-01 22:38:47 -04:00
parent 5df31a4895
commit 130c6e90d5

View file

@ -187,11 +187,12 @@ exist, and `org-link' otherwise."
(cl-destructuring-bind (&key category module flag) (cl-destructuring-bind (&key category module flag)
(+org-link--doom-module--read-link link) (+org-link--doom-module--read-link link)
(when category (when category
(if-let* ((path (doom-module-locate-path category module)) (let ((doom-modules-dirs (list doom-modules-dir)))
(path (or (car (doom-glob path "README.org")) (if-let* ((path (doom-module-locate-path category module))
path))) (path (or (car (doom-glob path "README.org"))
(find-file path) path)))
(user-error "Can't find Doom module '%s'" link))) (find-file path)
(user-error "Can't find Doom module '%s'" link))))
(when flag (when flag
(goto-char (point-min)) (goto-char (point-min))
(and (re-search-forward "^\\*+ \\(?:TODO \\)?Module Flags") (and (re-search-forward "^\\*+ \\(?:TODO \\)?Module Flags")