From 5005721039f1486a7ff66732c1010f0638f61ff9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 21 Jul 2019 14:58:12 +0200 Subject: [PATCH] lang/emacs-lisp: make company-elisp use helpful Instead of describe-* --- core/core-editor.el | 7 +++++++ modules/lang/emacs-lisp/config.el | 3 +++ 2 files changed, 10 insertions(+) diff --git a/core/core-editor.el b/core/core-editor.el index 92c104561..2c56c2004 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -284,6 +284,13 @@ successfully sets indent_style/indent_size.") [remap describe-key] #'helpful-key [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 ;; patch apropos buttons to call helpful instead of help (dolist (fun-bt '(apropos-function apropos-macro apropos-command)) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index ef9510310..a2d8d3fab 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -56,6 +56,9 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.") (lisp-indent-defform state indent-point))) (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 #'(outline-minor-mode ;; fontificiation