diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-04-17 18:46:52 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-04-17 18:49:17 +0200 |
commit | 98720451918cb33a345021ce0f1541acbb4c918b (patch) | |
tree | fc62b4cb8a6062d89f4eaa5b8e067a1ec0aa1e6d | |
parent | e54deed13f3ccf3dc14d9a77417ee0688dc30987 (diff) |
add while-no-input call to capfs
-rw-r--r-- | lisp/mastodon-toot.el | 14 |
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) |