emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient c4bf4af655 020/366: transient--show-manpage:


From: Jonas Bernoulli
Subject: [elpa] externals/transient c4bf4af655 020/366: transient--show-manpage: Fix jumping to argument
Date: Tue, 25 Jan 2022 18:54:22 -0500 (EST)

branch: externals/transient
commit c4bf4af6553b0da8251a6cabd74fdf9b64a6fa17
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient--show-manpage: Fix jumping to argument
    
    `man' is run asynchronously and we have to wait for it to finish
    before we can act on its output.
---
 lisp/transient.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 9ee2cb5c4e..05d4baf6a4 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -59,6 +59,9 @@
 (declare-function info 'info)
 (declare-function Man-find-section 'man)
 (declare-function Man-next-section 'man)
+(declare-function Man-getpage-in-background 'man)
+
+(defvar Man-notify-method)
 
 ;;; Options
 
@@ -2469,9 +2472,15 @@ location."
   (transient--describe-function cmd))
 
 (defun transient--show-manpage (manpage &optional argument)
-  (select-window (get-buffer-window (man manpage)))
-  (when argument
-    (transient--goto-argument-description argument)))
+  (require 'man)
+  (let* ((Man-notify-method 'meek)
+         (buf (Man-getpage-in-background manpage))
+         (proc (get-buffer-process buf)))
+    (while (and proc (eq (process-status proc) 'run))
+      (accept-process-output proc))
+    (switch-to-buffer buf)
+    (when argument
+      (transient--goto-argument-description argument))))
 
 (defun transient--describe-function (fn)
   (describe-function fn)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]