Fix: (org-ql-search) Interactive completion

This commit is contained in:
Adam Porter 2019-10-06 00:48:09 -05:00
parent f4918b19dc
commit 0ed0ff6f6e
2 changed files with 8 additions and 5 deletions

View file

@ -392,6 +392,7 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience
*Fixed* *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 =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=). + 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* *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. + 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.

View file

@ -119,7 +119,7 @@ necessary."
("agenda" (org-agenda-files)) ("agenda" (org-agenda-files))
("all" (--select (equal (buffer-local-value 'major-mode it) 'org-mode) ("all" (--select (equal (buffer-local-value 'major-mode it) 'org-mode)
(buffer-list))) (buffer-list)))
("buffer" (current-buffer)) ((or "" "buffer") (current-buffer))
((and form (guard (rx bos "("))) (-flatten (eval (read form)))) ((and form (guard (rx bos "("))) (-flatten (eval (read form))))
(else (s-split (rx (1+ space)) else))) (else (s-split (rx (1+ space)) else)))
(read-string "Query: ") (read-string "Query: ")
@ -129,9 +129,10 @@ necessary."
(append (list "Don't group" (append (list "Don't group"
"Global super-groups") "Global super-groups")
(cl-loop for type in org-super-agenda-auto-selector-keywords (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) ("Global super-groups" org-super-agenda-groups)
("Don't group" nil) ((or "" "Don't group") nil)
(property (list (list (intern (concat ":auto-" property))))))) (property (list (list (intern (concat ":auto-" property)))))))
:sort (pcase (completing-read "Sort by: " :sort (pcase (completing-read "Sort by: "
(list "Don't sort" (list "Don't sort"
@ -139,8 +140,9 @@ necessary."
"deadline" "deadline"
"priority" "priority"
"scheduled" "scheduled"
"todo")) "todo")
("Don't sort" nil) nil t)
((or "" "Don't sort") nil)
(sort (intern sort))))) (sort (intern sort)))))
(let* ((query (cl-etypecase query (let* ((query (cl-etypecase query
(string (if (string-match-p (rx bos (1+ alpha) ":") query) (string (if (string-match-p (rx bos (1+ alpha) ":") query)