Merge pull request #1244 from flatwhatson/better-apropos

Improvements to apropos and describe-symbol
This commit is contained in:
Henrik Lissner 2019-03-12 11:27:42 -04:00 committed by GitHub
commit bee34f6a28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 7 deletions

View file

@ -320,6 +320,11 @@
(:after helpful-mode
:map helpful-mode-map
"o" #'ace-link-help)
(:after apropos
:map apropos-mode-map
"o" #'ace-link-help
"n" #'forward-button
"p" #'backward-button)
(:after info
:map Info-mode-map
"o" #'ace-link-info)

View file

@ -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 thing
(doom/describe-symbol thing)
(call-interactively #'doom/describe-symbol)))