From 56c601e4019ffdaf2c8421626d4c011eb03b3a02 Mon Sep 17 00:00:00 2001 From: Pablo Stafforini Date: Tue, 10 Mar 2026 11:46:49 -0300 Subject: 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. --- lisp/transient.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/transient.el b/lisp/transient.el index 94e90e2..a6c9a85 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -5314,7 +5314,8 @@ Select the help window, and make the help buffer current and return it." (cons (lambda () (setq buffer (current-buffer))) temp-buffer-window-setup-hook))) (describe-function fn) - (set-buffer buffer))) + (when buffer + (set-buffer buffer)))) (defun transient--show-manual (manual) (info manual)) -- cgit v1.0