branch: externals/timeout
commit b40c2753e663428884840d920cf0f5e3ac929fa4
Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>

    timeout: Fix assignment to free variable
    
    (timeout--debounce-advice): Don't assign to free variable `result'.
    (timeout-throttle!): Ensure `delay' is optional.
---
 timeout.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/timeout.el b/timeout.el
index e940e2936e..47be928ad2 100644
--- a/timeout.el
+++ b/timeout.el
@@ -77,7 +77,7 @@ This is intended for use as function advice."
                    (cancel-timer debounce-timer)
                    (setq debounce-timer nil)
                    (with-current-buffer buf
-                     (setq result (apply orig-fn args))))
+                     (apply orig-fn args)))
                  (current-buffer))))))))
 
 ;;;###autoload
@@ -92,7 +92,7 @@ DELAY defaults to 0.5 seconds. Using a delay of 0 resets the
 function.
 
 DEFAULT is the immediate return value of the function when called."
-  (if (= delay 0)
+  (if (and delay (= delay 0))
       (advice-remove func 'debounce)
     (advice-add func :around (timeout--debounce-advice delay default)
                 '((name . debounce)

Reply via email to