From 6728ddaaa7d00c134eb8dd18a48ce7d6ea5000ad Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 23 Jul 2019 21:25:32 -0500 Subject: [PATCH] Change: (--query-preamble) Simplify (todo) preamble --- org-ql.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/org-ql.el b/org-ql.el index f5574b6..4874030 100644 --- a/org-ql.el +++ b/org-ql.el @@ -288,13 +288,11 @@ replace the clause with a preamble." (`(todo . ,(and todo-keywords (guard todo-keywords))) ;; FIXME: With case-folding, a query like (todo "WAITING") ;; can find a non-todo heading named "Waiting". - (let* ((regexps (--map (list 'regexp - (format org-heading-keyword-regexp-format it)) - todo-keywords)) - (regexp (rx-to-string `(or ,@regexps) t))) - (setq org-ql-preamble regexp) - ;; Return nil - nil)) + (setq org-ql-preamble + (rx-to-string `(seq bol (1+ "*") (1+ space) (or ,@todo-keywords) (or " " eol)) + t)) + ;; Return nil + nil) (`(level ,comparator-or-num ,num) (let ((repeat (pcase comparator-or-num ('< `(repeat 1 ,(1- num) "*"))