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.
This commit is contained in:
Henrik Lissner 2023-09-12 17:00:28 +02:00
parent 0f0fade3c0
commit 8e671f494d
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -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)))