parent
4db4e411a0
commit
c4531b25a4
2 changed files with 14 additions and 6 deletions
|
|
@ -416,12 +416,11 @@ If NARROW is non-nil, buffer will not be widened."
|
||||||
(when (org-before-first-heading-p)
|
(when (org-before-first-heading-p)
|
||||||
(outline-next-heading))
|
(outline-next-heading))
|
||||||
;; `cl-loop' makes this double-while much clearer than the expanded form.
|
;; `cl-loop' makes this double-while much clearer than the expanded form.
|
||||||
(cond (preamble-re (cl-loop while (and (when (re-search-forward preamble-re nil t)
|
(cond (preamble-re (cl-loop while (re-search-forward preamble-re nil t)
|
||||||
(outline-back-to-heading 'invisible-ok)
|
do (outline-back-to-heading 'invisible-ok)
|
||||||
t)
|
when (funcall predicate)
|
||||||
(funcall predicate))
|
|
||||||
collect (funcall action)
|
collect (funcall action)
|
||||||
while (outline-next-heading)))
|
do (outline-next-heading)))
|
||||||
(t (cl-loop when (funcall predicate)
|
(t (cl-loop when (funcall predicate)
|
||||||
collect (funcall action)
|
collect (funcall action)
|
||||||
while (outline-next-heading)))))))
|
while (outline-next-heading)))))))
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,16 @@ Based on Buttercup macro `it'."
|
||||||
(expect (org-ql test-buffer
|
(expect (org-ql test-buffer
|
||||||
(ts :on "2019-06-09")
|
(ts :on "2019-06-09")
|
||||||
:action (org-ql-test-org-get-heading))
|
:action (org-ql-test-org-get-heading))
|
||||||
:to-equal nil)))))
|
:to-equal nil)))
|
||||||
|
|
||||||
|
(describe "Compound queries"
|
||||||
|
|
||||||
|
(org-ql-it "Tags and to-do"
|
||||||
|
(expect (org-ql test-buffer
|
||||||
|
(and (todo "SOMEDAY")
|
||||||
|
(tags "Emacs"))
|
||||||
|
:action (org-ql-test-org-get-heading))
|
||||||
|
:to-equal '("Rewrite Emacs in Common Lisp"))))))
|
||||||
|
|
||||||
;; Local Variables:
|
;; Local Variables:
|
||||||
;; truncate-lines: t
|
;; truncate-lines: t
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue