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 85f22aa
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions emacs/radian.el
Original file line number Diff line number Diff line change
Expand Up @@ -3963,10 +3963,17 @@ bizarre reason."
(func &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))))
(buf (apply func 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 85f22aa

Please sign in to comment.