aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/mastodon-toot.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index c2c391d..e7cf22c 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -996,7 +996,12 @@ If TAGS, we search for tags, else we search for handles."
;; only search when necessary:
(completion-table-dynamic
(lambda (_)
- (mastodon-toot--fetch-completion-candidates start end)))
+ ;; Interruptible candidate computation
+ ;; suggestion from minad (d mendler), thanks!
+ (let ((result
+ (while-no-input
+ (mastodon-toot--fetch-completion-candidates start end))))
+ (and (consp result) result))))
:exclusive 'no
:annotation-function
(lambda (candidate)
@@ -1015,7 +1020,12 @@ If TAGS, we search for tags, else we search for handles."
;; only search when necessary:
(completion-table-dynamic
(lambda (_)
- (mastodon-toot--fetch-completion-candidates start end :tags)))
+ ;; Interruptible candidate computation
+ ;; suggestion from minad (d mendler), thanks!
+ (let ((result
+ (while-no-input
+ (mastodon-toot--fetch-completion-candidates start end :tags))))
+ (and (consp result) result))))
:exclusive 'no
:annotation-function
(lambda (candidate)