summaryrefslogtreecommitdiff
path: root/cape.el
diff options
context:
space:
mode:
Diffstat (limited to 'cape.el')
-rw-r--r--cape.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/cape.el b/cape.el
index 13c1e5d..ea8e323 100644
--- a/cape.el
+++ b/cape.el
@@ -882,13 +882,14 @@ If INTERACTIVE is nil the function acts like a capf."
(funcall fetch
(lambda (arg)
(when (eq res 'cape--waiting)
- (push 'cape--done unread-command-events))
- (setq res arg)))
- (let ((ev (let (input-method-function) (read-event nil t))))
- (when (eq res 'cape--waiting)
+ (push 'cape--done unread-command-events)
+ (setq res arg))))
+ (when (eq res 'cape--waiting)
+ (let ((ev (let (input-method-function) (read-event nil t))))
(unless (eq ev 'cape--done)
- (push (cons t ev) unread-command-events))
- (throw toi t))))
+ (push (cons t ev) unread-command-events)
+ (setq res 'cape--cancelled)
+ (throw toi t)))))
(setq unread-command-events
(delq 'cape--done unread-command-events)))
(funcall fetch (lambda (arg) (setq res arg)))