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

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

[elpa] externals/company 8d2ca28a16 5/5: company-calculate-candidates: M


From: ELPA Syncer
Subject: [elpa] externals/company 8d2ca28a16 5/5: company-calculate-candidates: Make sure to cancel the "sneaky" timer
Date: Mon, 24 Jun 2024 21:57:41 -0400 (EDT)

branch: externals/company
commit 8d2ca28a161f8b912889684412bb1d7fb07d035c
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    company-calculate-candidates: Make sure to cancel the "sneaky" timer
    
    Even when the computation had been interrupted by `throw`.
    
    #1468
---
 company.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/company.el b/company.el
index fb564f1d25..7751e2d566 100644
--- a/company.el
+++ b/company.el
@@ -1576,10 +1576,11 @@ update if FORCE-UPDATE."
         ;; No cache match, call the backend.
         (let ((refresh-timer (run-with-timer company-async-redisplay-delay
                                              nil #'company--sneaky-refresh)))
-          (setq candidates (company--preprocess-candidates
-                            (company--fetch-candidates prefix)))
-          ;; If the backend is synchronous, no chance for the timer to run.
-          (cancel-timer refresh-timer)
+          (unwind-protect
+              (setq candidates (company--preprocess-candidates
+                                (company--fetch-candidates prefix)))
+            ;; If the backend is synchronous, no chance for the timer to run.
+            (cancel-timer refresh-timer))
           ;; Save in cache.
           (push (cons prefix candidates) company-candidates-cache)))
     ;; Only now apply the predicate and transformers.



reply via email to

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