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

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

[elpa] externals/transient 5762bd9a06 341/366: transient-hide-during-min


From: Jonas Bernoulli
Subject: [elpa] externals/transient 5762bd9a06 341/366: transient-hide-during-minibuffer-read: New option
Date: Tue, 25 Jan 2022 18:54:53 -0500 (EST)

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

    transient-hide-during-minibuffer-read: New option
---
 docs/transient.org |  5 +++++
 lisp/transient.el  | 16 +++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/docs/transient.org b/docs/transient.org
index a484f04b62..304e003609 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -656,6 +656,11 @@ Also see [[* Common Suffix Commands]].
   from the user.  If ~nil~, then there is no initial input and the first
   element has to be accessed the same way as the older elements.
 
+- User Option: transient-hide-during-minibuffer-read ::
+
+  This option controls whether the transient buffer is hidden while
+  user input is being read in the minibuffer.
+
 - User Option: transient-force-fixed-pitch ::
 
   This option controls whether to force the use of a monospaced font
diff --git a/lisp/transient.el b/lisp/transient.el
index 25c91dcb7f..ad6bb74cb0 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -337,6 +337,12 @@ text and might otherwise have to scroll in two dimensions."
   :group 'transient
   :type 'boolean)
 
+(defcustom transient-hide-during-minibuffer-read nil
+  "Whether to hide the transient buffer while reading in the minibuffer."
+  :package-version '(transient . "0.4.0")
+  :group 'transient
+  :type 'boolean)
+
 (defconst transient--default-child-level 1)
 
 (defconst transient--default-prefix-level 4)
@@ -2023,8 +2029,10 @@ value.  Otherwise return CHILDREN as is."
   (setq transient-current-suffixes transient--suffixes)
   (transient--history-push transient--prefix))
 
-(defun transient--suspend-override ()
+(defun transient--suspend-override (&optional nohide)
   (transient--debug 'suspend-override)
+  (when (and (not nohide) transient-hide-during-minibuffer-read)
+    (transient--delete-window))
   (transient--pop-keymap 'transient--transient-map)
   (transient--pop-keymap 'transient--redisplay-map)
   (remove-hook 'pre-command-hook  #'transient--pre-command)
@@ -2032,6 +2040,8 @@ value.  Otherwise return CHILDREN as is."
 
 (defun transient--resume-override ()
   (transient--debug 'resume-override)
+  (when (and transient--showp transient-hide-during-minibuffer-read)
+    (transient--show))
   (transient--push-keymap 'transient--transient-map)
   (transient--push-keymap 'transient--redisplay-map)
   (add-hook 'pre-command-hook  #'transient--pre-command)
@@ -3711,7 +3721,7 @@ search instead."
 
 (defun transient--isearch-setup ()
   (select-window transient--window)
-  (transient--suspend-override))
+  (transient--suspend-override t))
 
 (defun transient--isearch-exit ()
   (select-window transient--original-window)
@@ -3753,7 +3763,7 @@ search instead."
   (transient--debug 'edebug--recursive-edit)
   (if (not transient--prefix)
       (funcall fn arg-mode)
-    (transient--suspend-override)
+    (transient--suspend-override t)
     (funcall fn arg-mode)
     (transient--resume-override)))
 



reply via email to

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