[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 732ec975ec 5/6: transient--describe-function:
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 732ec975ec 5/6: transient--describe-function: Refactor setting help buffer/window |
Date: |
Sun, 29 Sep 2024 15:21:08 -0400 (EDT) |
branch: externals/transient
commit 732ec975ec0a9597c4bb4ce79c6040da72a66df2
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient--describe-function: Refactor setting help buffer/window
Bind `help-window-select' to select the window used to display the help
buffer. Use `temp-buffer-window-setup-hook' to get our hands at that
buffer, despite `describe-function' (and the lower-level functions it
uses) neither returning the used buffer nor making it current.
`transient-show-help' expects the used buffer to be current after
calling functions such as this one, so that it can finish its own setup
of that buffer.
---
lisp/transient.el | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index 54fec732b6..eb38eff8ef 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -4226,15 +4226,13 @@ manpage, then try to jump to the correct location."
(transient--describe-function cmd))
(defun transient--describe-function (fn)
- (describe-function fn)
- (when-let* (((not (derived-mode-p 'help-mode)))
- (buf (get-buffer "*Help*"))
- (win (or (and buf (get-buffer-window buf))
- (cl-find-if (lambda (win)
- (with-current-buffer (window-buffer win)
- (derived-mode-p 'help-mode)))
- (window-list)))))
- (select-window win)))
+ (let* ((buffer nil)
+ (help-window-select t)
+ (temp-buffer-window-setup-hook
+ (cons (lambda () (setq buffer (current-buffer)))
+ temp-buffer-window-setup-hook)))
+ (describe-function fn)
+ (set-buffer buffer)))
(defun transient--show-manual (manual)
(info manual))
- [elpa] externals/transient updated (306645aa59 -> 5fcd713873), Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient f67500bfd2 2/6: Combine some conditionals, Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient 732ec975ec 5/6: transient--describe-function: Refactor setting help buffer/window,
Jonas Bernoulli <=
- [elpa] externals/transient 4587f8d8de 3/6: Update changelog, Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient 683e5104a0 4/6: fixup(f67500bf): Combine some conditionals, Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient 5fcd713873 6/6: transient-with-help-window: New macro, Jonas Bernoulli, 2024/09/29
- [elpa] externals/transient 880b21adfa 1/6: gitignore: /lisp/*-pkg.el, Jonas Bernoulli, 2024/09/29