From 3d8efb71d8e2dd6a4447e55b20253eec8daa5ff3 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 22 Sep 2023 23:12:06 -0500 Subject: [PATCH] Fix: (org-ql-completing-read-snippet) while-no-input --- org-ql-completing-read.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index fa6879f7..c50f4411 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -91,13 +91,17 @@ Returns value returned by function `org-ql-completing-read-snippet-function' or `org-ql-completing-read--snippet-simple', whichever returns a value, or nil." - (while-no-input - ;; Using `while-no-input' here doesn't make it as - ;; responsive as, e.g. Helm while typing, but it seems to - ;; help a little when using the org-rifle-style snippets. - (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function) - (org-ql-completing-read--snippet-simple))))) + (pcase (while-no-input + ;; Using `while-no-input' here doesn't make it as + ;; responsive as, e.g. Helm while typing, but it seems to + ;; help a little when using the org-rifle-style snippets. + (org-with-point-at marker + (or (funcall org-ql-completing-read-snippet-function) + (org-ql-completing-read--snippet-simple)))) + (t + ;; Interrupted: return nil (which can be concatted). + nil) + (else else))) (defun org-ql-completing-read-path (marker) "Return formatted outline path for entry at MARKER."