Skip to content

Commit

Permalink
Fix advice for elisp--company-doc-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
haji-ali committed Sep 28, 2024
1 parent ae0e928 commit 97acd14
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions emacs/radian.el
Original file line number Diff line number Diff line change
Expand Up @@ -3960,13 +3960,21 @@ bizarre reason."

(with-eval-after-load 'helpful
(radian-defadvice radian--advice-company-elisp-use-helpful
(func &rest args)
(func str &rest args)
:around #'elisp--company-doc-buffer
"Cause `company' to use Helpful to show Elisp documentation."
(cl-letf (((symbol-function #'describe-function) #'helpful-function)
((symbol-function #'describe-variable) #'helpful-variable)
((symbol-function #'help-buffer) #'current-buffer))
(apply func args))))
(cl-letf* ((helpful-buffer nil)
((symbol-function #'describe-function)
(lambda (&rest args)
(apply 'helpful-function args)
(setq helpful-buffer (current-buffer))))
((symbol-function #'describe-variable)
(lambda (&rest args)
(apply 'helpful-variable args)
(setq helpful-buffer (current-buffer))))
(symbol (intern-soft str))
(buf (apply func symbol args)))
(or helpful-buffer buf))))

(radian-defadvice radian--advice-fill-elisp-docstrings-correctly (&rest _)
:before-until #'fill-context-prefix
Expand Down

0 comments on commit 97acd14

Please sign in to comment.