lang/emacs-lisp: make company-elisp use helpful

Instead of describe-*
This commit is contained in:
Henrik Lissner 2019-07-21 14:58:12 +02:00
parent 62f2f6af48
commit 5005721039
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 10 additions and 0 deletions

View file

@ -284,6 +284,13 @@ successfully sets indent_style/indent_size.")
[remap describe-key] #'helpful-key [remap describe-key] #'helpful-key
[remap describe-symbol] #'doom/describe-symbol) [remap describe-symbol] #'doom/describe-symbol)
(defun doom-use-helpful-a (orig-fn &rest args)
"Force ORIG-FN to use helpful instead of the old describe-* commands."
(cl-letf (((symbol-function #'describe-function) #'helpful-function)
((symbol-function #'describe-variable) #'helpful-variable)
((symbol-function #'help-buffer) #'current-buffer))
(apply orig-fn args)))
(after! apropos (after! apropos
;; patch apropos buttons to call helpful instead of help ;; patch apropos buttons to call helpful instead of help
(dolist (fun-bt '(apropos-function apropos-macro apropos-command)) (dolist (fun-bt '(apropos-function apropos-macro apropos-command))

View file

@ -56,6 +56,9 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
(lisp-indent-defform state indent-point))) (lisp-indent-defform state indent-point)))
(put 'add-hook 'lisp-indent-function #'+emacs-lisp--indent-add-hook-fn) (put 'add-hook 'lisp-indent-function #'+emacs-lisp--indent-add-hook-fn)
;; Use helpful instead of describe-* from `company'
(advice-add #'elisp--company-doc-buffer :around #'doom-use-helpful-a)
(add-hook! 'emacs-lisp-mode-hook (add-hook! 'emacs-lisp-mode-hook
#'(outline-minor-mode #'(outline-minor-mode
;; fontificiation ;; fontificiation