From 0ed0ff6f6ea65af9ce3fa8d38091ba474d4233b0 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 6 Oct 2019 00:48:09 -0500 Subject: [PATCH] Fix: (org-ql-search) Interactive completion --- README.org | 1 + org-ql-search.el | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index 8a6a079..b13689f 100644 --- a/README.org +++ b/README.org @@ -392,6 +392,7 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience *Fixed* + Predicate =heading= now matches only against heading text, i.e. not including tags at the end of the line, to-do keyword, etc. + Predicate =todo= now matches case-sensitively, avoiding non-todo-keyword matches (e.g. a heading which begins =Waiting on= will no longer match for a todo keyword =WAITING=). ++ Interactive completion in =org-ql-search=. *Internal* + Refactored code from file =org-ql-agenda.el= into files =org-ql-search.el= and =org-ql-view.el=. Function and variable names have been changed accordingly. diff --git a/org-ql-search.el b/org-ql-search.el index c97a1d0..45f349a 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -119,7 +119,7 @@ necessary." ("agenda" (org-agenda-files)) ("all" (--select (equal (buffer-local-value 'major-mode it) 'org-mode) (buffer-list))) - ("buffer" (current-buffer)) + ((or "" "buffer") (current-buffer)) ((and form (guard (rx bos "("))) (-flatten (eval (read form)))) (else (s-split (rx (1+ space)) else))) (read-string "Query: ") @@ -129,9 +129,10 @@ necessary." (append (list "Don't group" "Global super-groups") (cl-loop for type in org-super-agenda-auto-selector-keywords - collect (substring (symbol-name type) 6)))) + collect (substring (symbol-name type) 6))) + nil t) ("Global super-groups" org-super-agenda-groups) - ("Don't group" nil) + ((or "" "Don't group") nil) (property (list (list (intern (concat ":auto-" property))))))) :sort (pcase (completing-read "Sort by: " (list "Don't sort" @@ -139,8 +140,9 @@ necessary." "deadline" "priority" "scheduled" - "todo")) - ("Don't sort" nil) + "todo") + nil t) + ((or "" "Don't sort") nil) (sort (intern sort))))) (let* ((query (cl-etypecase query (string (if (string-match-p (rx bos (1+ alpha) ":") query)