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

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

[elpa] externals/consult 888b452536 5/5: consult--async-throttle: Better


From: ELPA Syncer
Subject: [elpa] externals/consult 888b452536 5/5: consult--async-throttle: Better computation of the throttle delay
Date: Sun, 25 Feb 2024 12:57:39 -0500 (EST)

branch: externals/consult
commit 888b4525361c4050f35f4766fe7651c97d3274ce
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    consult--async-throttle: Better computation of the throttle delay
---
 consult.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/consult.el b/consult.el
index 7d9aee4c13..a4caafbfef 100644
--- a/consult.el
+++ b/consult.el
@@ -2302,7 +2302,7 @@ The THROTTLE delay defaults to 
`consult-async-input-throttle'.
 The DEBOUNCE delay defaults to `consult-async-input-debounce'."
   (setq throttle (or throttle consult-async-input-throttle)
         debounce (or debounce consult-async-input-debounce))
-  (let* ((input "") (timer (timer-create)) last)
+  (let* ((input "") (timer (timer-create)) (last 0))
     (lambda (action)
       (pcase action
         ((pred stringp)
@@ -2317,7 +2317,7 @@ The DEBOUNCE delay defaults to 
`consult-async-input-debounce'."
              (timer-set-time
               timer
               (timer-relative-time
-               nil (max debounce (if last (min (- (float-time) last) throttle) 
0))))
+               nil (max debounce (- (+ last throttle) (float-time)))))
              (timer-activate timer)))
          nil)
         ('destroy



reply via email to

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