Change: (--query-preamble) Use pcase for clarity
This commit is contained in:
parent
0fdfa65bef
commit
a56d173eb5
1 changed files with 38 additions and 38 deletions
|
|
@ -261,8 +261,9 @@ a list of defined `org-ql' sorting methods: `date', `deadline',
|
||||||
When QUERY has a clause with a corresponding preamble, and it's
|
When QUERY has a clause with a corresponding preamble, and it's
|
||||||
appropriate to use one (i.e. the clause is not in an `or'),
|
appropriate to use one (i.e. the clause is not in an `or'),
|
||||||
replace the clause with a preamble."
|
replace the clause with a preamble."
|
||||||
(if org-ql-use-preamble
|
(pcase org-ql-use-preamble
|
||||||
(let (org-ql-preamble)
|
('nil (list query nil))
|
||||||
|
(_ (let (org-ql-preamble)
|
||||||
(cl-labels ((rec (element)
|
(cl-labels ((rec (element)
|
||||||
(or (when org-ql-preamble
|
(or (when org-ql-preamble
|
||||||
;; Only one preamble is allowed
|
;; Only one preamble is allowed
|
||||||
|
|
@ -297,8 +298,7 @@ replace the clause with a preamble."
|
||||||
`((or)))
|
`((or)))
|
||||||
t)
|
t)
|
||||||
(query (-flatten-n 1 query))))
|
(query (-flatten-n 1 query))))
|
||||||
(list query org-ql-preamble)))
|
(list query org-ql-preamble))))))
|
||||||
(list query nil)))
|
|
||||||
|
|
||||||
(defun org-ql--select-cached (&rest args)
|
(defun org-ql--select-cached (&rest args)
|
||||||
"Return results for ARGS and current buffer using cache."
|
"Return results for ARGS and current buffer using cache."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue