mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Improve doom/describe-module
Opens module's README.org, if present, otherwise it prompts if you want to browse the module's root.
This commit is contained in:
@ -193,9 +193,15 @@ current file is in, or d) the module associated with the current major mode (see
|
|||||||
(intern (cadr key)))))
|
(intern (cadr key)))))
|
||||||
(cl-check-type category symbol)
|
(cl-check-type category symbol)
|
||||||
(cl-check-type module symbol)
|
(cl-check-type module symbol)
|
||||||
(or (doom-module-p category module)
|
(let ((path (doom-module-locate-path category module)))
|
||||||
(error "'%s %s' isn't a valid module" category module))
|
(unless (file-readable-p path)
|
||||||
(doom-project-browse (doom-module-path category module)))
|
(error "'%s %s' isn't a valid module; it doesn't exist" category module))
|
||||||
|
(if-let* ((readme-path (doom-module-locate-path category module "README.org")))
|
||||||
|
(find-file readme-path)
|
||||||
|
(if (y-or-n-p (format "The '%s %s' module has no README file. Explore its directory?"
|
||||||
|
category module))
|
||||||
|
(doom-project-browse path)
|
||||||
|
(user-error "Aborted module lookup")))))
|
||||||
|
|
||||||
(defun doom--describe-package-insert-button (label path &optional regexp)
|
(defun doom--describe-package-insert-button (label path &optional regexp)
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
|
Reference in New Issue
Block a user