Skip to content

Commit 56c601e

Browse files
benthamitetarsius
authored andcommitted
transient--describe-function: Handle describe-function overrides
`transient--describe-function' captures the help buffer via `temp-buffer-window-setup-hook'. This works with the built-in `describe-function', which displays its output via `with-help-window' and therefore triggers the hook. However, a common pattern in the Emacs community is to override `describe-function' with a function provided by a packages like `helpful'. `helpful-function' creates and displays its buffer via `pop-to-buffer' rather than `with-help-window', so `temp-buffer-window-setup-hook' never fires and `buffer' stays nil, causing (set-buffer nil) to signal `wrong-type-argument'. See #431.
1 parent b4b5cc2 commit 56c601e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lisp/transient.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5314,7 +5314,8 @@ Select the help window, and make the help buffer current and return it."
53145314
(cons (lambda () (setq buffer (current-buffer)))
53155315
temp-buffer-window-setup-hook)))
53165316
(describe-function fn)
5317-
(set-buffer buffer)))
5317+
(when buffer
5318+
(set-buffer buffer))))
53185319

53195320
(defun transient--show-manual (manual)
53205321
(info manual))

0 commit comments

Comments
 (0)