fix(emacs-lisp): lookup docs backend w/o helpful
Use `helpful-symbol` if it's present and the symbol at point doesn't represent a cl-type (falling back to `describe-symbol` otherwise). Fix: #8068
This commit is contained in:
parent
22d5e3059f
commit
0b2ccac007
1 changed files with 15 additions and 4 deletions
|
@ -95,6 +95,15 @@ Intended to replace `lisp-outline-level'."
|
||||||
(doom/help-modules (car module) (cadr module) 'visit-dir)
|
(doom/help-modules (car module) (cadr module) 'visit-dir)
|
||||||
(call-interactively #'elisp-def)))
|
(call-interactively #'elisp-def)))
|
||||||
|
|
||||||
|
(defun +emacs-lisp--describe-symbol (symbol)
|
||||||
|
(if (or (not (fboundp 'helpful-symbol))
|
||||||
|
(cl-some (lambda (x) (funcall (nth 1 x) symbol))
|
||||||
|
describe-symbol-backends))
|
||||||
|
(progn
|
||||||
|
(describe-symbol symbol)
|
||||||
|
(pop-to-buffer (help-buffer)))
|
||||||
|
(helpful-symbol symbol)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +emacs-lisp-lookup-documentation (thing)
|
(defun +emacs-lisp-lookup-documentation (thing)
|
||||||
"Lookup THING with `helpful-variable' if it's a variable, `helpful-callable'
|
"Lookup THING with `helpful-variable' if it's a variable, `helpful-callable'
|
||||||
|
@ -117,10 +126,12 @@ if it's callable, `apropos' otherwise."
|
||||||
(org-show-hidden-entry))))
|
(org-show-hidden-entry))))
|
||||||
'deferred))
|
'deferred))
|
||||||
(thing
|
(thing
|
||||||
(funcall (if (fboundp #'helpful-symbol)
|
(let ((thing (intern thing)))
|
||||||
#'helpful-symbol
|
(if (and (not (cl-find-class thing))
|
||||||
#'describe-symbol)
|
(fboundp 'helpful-symbol))
|
||||||
(intern thing)))
|
(helpful-symbol thing)
|
||||||
|
(describe-symbol thing)
|
||||||
|
(pop-to-buffer (help-buffer)))))
|
||||||
((call-interactively
|
((call-interactively
|
||||||
(if (fboundp #'helpful-at-point)
|
(if (fboundp #'helpful-at-point)
|
||||||
#'helpful-at-point
|
#'helpful-at-point
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue