From 8e671f494d5dd4906d8f2715364ec7ccd0ad34cf Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 Sep 2023 17:00:28 +0200 Subject: [PATCH] fix(emacs-lisp): failure to look up module docs Incorrect regex would cause (search-failed "\* ...$") errors, and would fail to unfold the target entries if it was hidden. --- modules/lang/emacs-lisp/autoload.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index 5eb7ee499..b2e650320 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -102,15 +102,18 @@ if it's callable, `apropos' otherwise." (cond ((when-let (module (+emacs-lisp--module-at-point)) (doom/help-modules (car module) (cadr module)) (when (eq major-mode 'org-mode) + (goto-char (point-min)) (with-demoted-errors "%s" (re-search-forward (if (caddr module) - "\\* Module flags$" - "\\* Description$")) + "^\\*+ Module flags" + "^\\* Description")) (when (caddr module) (re-search-forward (format "=\\%s=" (caddr module)) nil t)) - (when (invisible-p (point)) + (when (memq (get-char-property (line-end-position) + 'invisible) + '(outline org-fold-outline)) (org-show-hidden-entry)))) 'deferred)) (thing (helpful-symbol (intern thing)))