mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Improvements to apropos and describe-symbol
Patch the apropos button types so they call helpful instead of the built-in describe functions. Also add some bindings to apropos-mode-map so it behaves like other help modes. Add `doom/describe-symbol` function, which shows documentation for callable and variable symbols. If a symbol is both a variable and a callable, it dispatches to apropos. This gives a better workflow than `helpful-symbol`, which annoyingly prompts the user. Remap `describe-symbol` to `doom/describe-symbol`, and update `+emacs-lisp-lookup-documentation` to call it also.
This commit is contained in:
@ -126,9 +126,8 @@ library/userland functions"
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp-lookup-documentation (thing)
|
||||
"Lookup THING with `helpful-symbol' if it's a symbol, apropos otherwise."
|
||||
(cond ((not thing)
|
||||
(call-interactively #'helpful-symbol))
|
||||
((if-let* ((sym (intern-soft thing))) (helpful-symbol sym)))
|
||||
((apropos (format "^%s" thing)))
|
||||
((apropos thing))))
|
||||
"Lookup THING with `helpful-variable' if it's a variable, `helpful-callable'
|
||||
if it's callable, `apropos' otherwise."
|
||||
(if (not thing)
|
||||
(call-interactively #'doom/describe-symbol)
|
||||
(doom/describe-symbol thing)))
|
||||
|
Reference in New Issue
Block a user