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

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

[elpa] externals/corfu f8bed9212e 4/6: corfu-popupinfo: Fix timer handli


From: ELPA Syncer
Subject: [elpa] externals/corfu f8bed9212e 4/6: corfu-popupinfo: Fix timer handling
Date: Mon, 21 Nov 2022 16:57:36 -0500 (EST)

branch: externals/corfu
commit f8bed9212eb79bbcdade7ab3104702a3a118cfe2
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    corfu-popupinfo: Fix timer handling
---
 extensions/corfu-echo.el      |  2 +-
 extensions/corfu-popupinfo.el | 11 ++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/extensions/corfu-echo.el b/extensions/corfu-echo.el
index 21637b75e7..4613e0bcae 100644
--- a/extensions/corfu-echo.el
+++ b/extensions/corfu-echo.el
@@ -39,7 +39,7 @@
   "Face used for echo area messages."
   :group 'corfu-faces)
 
-(defcustom corfu-echo-delay '(1.0 . 0.5)
+(defcustom corfu-echo-delay '(2.0 . 1.0)
   "Show documentation string in the echo area after that number of seconds.
 Set to t for an instant message. The value can be a pair of two
 floats to specify initial and subsequent delay."
diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index 6dcece1e38..0fff73f82e 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -54,7 +54,7 @@
   "Face used for the info popup."
   :group 'corfu-faces)
 
-(defcustom corfu-popupinfo-delay '(1.0 . 0.5)
+(defcustom corfu-popupinfo-delay '(2.0 . 1.0)
   "Automatically update info popup after that number of seconds.
 
 Set to t for an instant update. The value can be a pair of two
@@ -362,6 +362,7 @@ the candidate popup, its value is 'bottom, 'top, 'right or 
'left."
                 (corfu--make-frame corfu-popupinfo--frame
                                    area-x area-y area-w area-h
                                    " *corfu-popupinfo*")
+                corfu-popupinfo--toggle t
                 corfu-popupinfo--direction area-d
                 corfu-popupinfo--candidate candidate
                 corfu-popupinfo--coordinates new-coords)
@@ -437,15 +438,15 @@ not be displayed until this command is called again, even 
if
   (when completion-in-region-mode
     (setf (alist-get #'corfu-popupinfo-mode minor-mode-overriding-map-alist)
           corfu-popupinfo-map)
+    (when corfu-popupinfo--timer
+      (cancel-timer corfu-popupinfo--timer)
+      (setq corfu-popupinfo--timer nil))
     (if (and (>= corfu--index 0) (corfu-popupinfo--visible-p corfu--frame))
         (when-let* ((delay (if (consp corfu-popupinfo-delay)
-                               (funcall (if (corfu-popupinfo--visible-p) #'cdr 
#'car)
+                               (funcall (if (eq corfu-popupinfo--toggle 'init) 
#'car #'cdr)
                                         corfu-popupinfo-delay)
                              corfu-popupinfo-delay))
                     (corfu-popupinfo--toggle))
-          (when corfu-popupinfo--timer
-            (cancel-timer corfu-popupinfo--timer)
-            (setq corfu-popupinfo--timer nil))
           (let ((candidate (nth corfu--index corfu--candidates)))
             (if (or (eq delay t) (<= delay 0)
                     (equal candidate corfu-popupinfo--candidate))



reply via email to

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