summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Stafforini <pablo@stafforini.com>2026-03-10 11:46:49 -0300
committerJonas Bernoulli <jonas@bernoul.li>2026-03-10 21:31:49 +0100
commit56c601e4019ffdaf2c8421626d4c011eb03b3a02 (patch)
tree29629c90fcbd5413eb9ab333c1f4187181c96168
parentb4b5cc2624e156d7889b776a3855a3e46a227a05 (diff)
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.
-rw-r--r--lisp/transient.el3
1 files changed, 2 insertions, 1 deletions
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))