branch: externals/corfu
commit cc2ed14939d3fa3b196bee95933c0bb3fc32ee89
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    corfu--hide-frame: Hide immediately on TTY
    
    In contrast to GUI, there is no advantage in deferring frame hiding, since 
there
    is no communication with an X server.
---
 corfu.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/corfu.el b/corfu.el
index 47a5ad2f62..ee68c08824 100644
--- a/corfu.el
+++ b/corfu.el
@@ -564,10 +564,14 @@ FRAME is the existing frame."
 
 (defun corfu--hide-frame (frame)
   "Hide child FRAME."
-  (when (and (frame-live-p frame) (frame-visible-p frame)
-             (not (frame-parameter frame 'corfu--hide-timer)))
-    (set-frame-parameter frame 'corfu--hide-timer
-                         (run-at-time 0 nil #'corfu--hide-frame-deferred 
frame))))
+  (when (and (frame-live-p frame) (frame-visible-p frame))
+    (cond
+     ((not (display-graphic-p frame))
+      (corfu--hide-frame-deferred frame))
+     ((not (frame-parameter frame 'corfu--hide-timer))
+      (set-frame-parameter
+       frame 'corfu--hide-timer
+       (run-at-time 0 nil #'corfu--hide-frame-deferred frame))))))
 
 (defun corfu--move-to-front (elem list)
   "Move ELEM to front of LIST."

Reply via email to