[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape b3e2850fcf 108/146: Add unwind-protect
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape b3e2850fcf 108/146: Add unwind-protect |
Date: |
Sun, 9 Jan 2022 20:57:46 -0500 (EST) |
branch: externals/cape
commit b3e2850fcfe63d06f8e00ba985d964a4ba6e3935
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add unwind-protect
---
cape.el | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/cape.el b/cape.el
index 6251e114f5..d653593af5 100644
--- a/cape.el
+++ b/cape.el
@@ -744,20 +744,22 @@ If INTERACTIVE is nil the function acts like a capf."
(`(:async . ,future)
(let ((res 'cape--waiting)
(start (time-to-seconds)))
- (funcall future (lambda (arg)
- (when (eq res 'cape--waiting)
- (push 'cape--event unread-command-events))
- (setq res arg)))
- ;; Force synchronization.
- (while (eq res 'cape--waiting)
- ;; When we've got input, interrupt the computation.
- (when (and unread-command-events toi)
- (throw toi nil))
- (when (> (- (time-to-seconds) start) cape-company-timeout)
- (error "Cape company backend async timeout"))
- (sit-for 0.1 'noredisplay))
- ;; Remove cape--events introduced by future callback
- (setq unread-command-events (delq 'cape--event unread-command-events))
+ (unwind-protect
+ (progn
+ (funcall future (lambda (arg)
+ (when (eq res 'cape--waiting)
+ (push 'cape--event unread-command-events))
+ (setq res arg)))
+ ;; Force synchronization.
+ (while (eq res 'cape--waiting)
+ ;; When we've got input, interrupt the computation.
+ (when (and unread-command-events toi)
+ (throw toi nil))
+ (when (> (- (time-to-seconds) start) cape-company-timeout)
+ (error "Cape company backend async timeout"))
+ (sit-for 0.1 'noredisplay)))
+ ;; Remove cape--events introduced by future callback
+ (setq unread-command-events (delq 'cape--event
unread-command-events)))
res))
(res res))))
- [elpa] externals/cape 1b4b739639 059/146: Refactoring, (continued)
- [elpa] externals/cape 1b4b739639 059/146: Refactoring, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b63deab5af 058/146: cape--cached-table: Add category, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 11bcf51724 064/146: Ensure that cape-line is not sorted, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 33850ae000 068/146: Unify cape-dict and cape-dict-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 241dde47ca 070/146: Unify cape-keyword and cape-keyword-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape eaa408779e 072/146: cape-symbol: Implement capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape eff4f34841 084/146: Add cape-noninterruptible-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape fd8828cff3 100/146: Make cape--company-call more robust, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 1d0d3abbd1 102/146: Use namespaced symbol, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 4aec140c08 109/146: Minor cleanup, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b3e2850fcf 108/146: Add unwind-protect,
ELPA Syncer <=
- [elpa] externals/cape e81e3cfd4e 112/146: Indent, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b895c8cf28 114/146: cape-capf-case-fold: Add dont-fold, ELPA Syncer, 2022/01/09
- [elpa] externals/cape c0343a247c 123/146: cape-tex/sgml: Improve docsig, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 6d076f2480 129/146: README: Document company--multi-backend-adapter, ELPA Syncer, 2022/01/09
- [elpa] externals/cape c8c0a9f9a6 134/146: Simplify, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 5319e343bb 136/146: Improve repair function, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 12b00151d1 143/146: Improve and simplify cape-dabbrev, ELPA Syncer, 2022/01/09
- [elpa] externals/cape be2014538a 144/146: cape-dabbrev: Use thing-at-point-looking-at, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 5ccece0e34 146/146: Add to GNU ELPA, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 700c9d7bc2 137/146: Remove cape-repair-misbehaving-capf, ELPA Syncer, 2022/01/09