Add new emacs-lisp :documentation lookup handler
Made to do-what-I-mean. Uses describe-symbol/helpful-symbol and falls back to apropos.
This commit is contained in:
parent
27822ef006
commit
c7aa41599d
2 changed files with 10 additions and 1 deletions
|
@ -122,3 +122,12 @@ library/userland functions"
|
||||||
if (file-in-directory-p buffer-file-name dir)
|
if (file-in-directory-p buffer-file-name dir)
|
||||||
return t)))
|
return t)))
|
||||||
(flycheck-mode -1)))
|
(flycheck-mode -1)))
|
||||||
|
|
||||||
|
;;;###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))))
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
(set-eval-handler! 'emacs-lisp-mode #'+emacs-lisp-eval)
|
(set-eval-handler! 'emacs-lisp-mode #'+emacs-lisp-eval)
|
||||||
(set-lookup-handlers! 'emacs-lisp-mode
|
(set-lookup-handlers! 'emacs-lisp-mode
|
||||||
:definition #'elisp-def
|
:definition #'elisp-def
|
||||||
:documentation #'info-lookup-symbol)
|
:documentation #'+emacs-lisp-lookup-documentation)
|
||||||
(set-docsets! 'emacs-lisp-mode "Emacs Lisp")
|
(set-docsets! 'emacs-lisp-mode "Emacs Lisp")
|
||||||
(set-pretty-symbols! 'emacs-lisp-mode :lambda "lambda")
|
(set-pretty-symbols! 'emacs-lisp-mode :lambda "lambda")
|
||||||
(set-rotate-patterns! 'emacs-lisp-mode
|
(set-rotate-patterns! 'emacs-lisp-mode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue