diff --git a/org-ql.el b/org-ql.el index 7a9755f..1699db6 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1,3 +1,6 @@ +;; -*- lexical-binding: t; -*- + + ;;; Code: ;;;; Requirements @@ -79,30 +82,31 @@ Headings should return non-nil for any ANY-PREDS and nil for all NONE-PREDS. If NARROW is non-nil, buffer will not be widened first." ;; Cache `org-today' so we don't have to run it repeatedly. - (cl-letf ((today org-ql--today)) - (org-ql--fmap ((category #'org-ql--category-p) - (date #'org-ql--date-plain-p) - (deadline #'org-ql--deadline-p) - (scheduled #'org-ql--scheduled-p) - (closed #'org-ql--closed-p) - (habit #'org-ql--habit-p) - (priority #'org-ql--priority-p) - (todo #'org-ql--todo-p) - (done #'org-ql--done-p) - (tags #'org-ql--tags-p) - (property #'org-ql--property-p) - (regexp #'org-ql--regexp-p) - (org-back-to-heading #'outline-back-to-heading)) - (save-excursion - (save-restriction - (unless narrow - (widen)) - (goto-char (point-min)) - (when (org-before-first-heading-p) - (outline-next-heading)) - (cl-loop when (funcall pred) - collect (org-element-headline-parser (line-end-position)) - while (outline-next-heading))))))) + (let (today) + (cl-letf ((today org-ql--today)) + (org-ql--fmap ((category #'org-ql--category-p) + (date #'org-ql--date-plain-p) + (deadline #'org-ql--deadline-p) + (scheduled #'org-ql--scheduled-p) + (closed #'org-ql--closed-p) + (habit #'org-ql--habit-p) + (priority #'org-ql--priority-p) + (todo #'org-ql--todo-p) + (done #'org-ql--done-p) + (tags #'org-ql--tags-p) + (property #'org-ql--property-p) + (regexp #'org-ql--regexp-p) + (org-back-to-heading #'outline-back-to-heading)) + (save-excursion + (save-restriction + (unless narrow + (widen)) + (goto-char (point-min)) + (when (org-before-first-heading-p) + (outline-next-heading)) + (cl-loop when (funcall pred) + collect (org-element-headline-parser (line-end-position)) + while (outline-next-heading)))))))) ;;;;; Predicates