Fix: (org-ql) Set "today" to org-ql--today in symbol-macrolet
Since we byte-compile the lambda, this is necessary (at least, I think this is why). Remember that we set org-ql--today when we actually run queries.
This commit is contained in:
parent
4c045f78ea
commit
fe3d5c2bd8
1 changed files with 25 additions and 26 deletions
|
|
@ -32,7 +32,8 @@ buffer (the default is to widen and search the entire buffer)."
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
`(org-ql--query ,buffers-or-files
|
`(org-ql--query ,buffers-or-files
|
||||||
(byte-compile (lambda ()
|
(byte-compile (lambda ()
|
||||||
(cl-symbol-macrolet ((= #'=)
|
(cl-symbol-macrolet ((today org-ql--today) ; Necessary because of byte-compiling the lambda
|
||||||
|
(= #'=)
|
||||||
(< #'<)
|
(< #'<)
|
||||||
(> #'>)
|
(> #'>)
|
||||||
(<= #'<=)
|
(<= #'<=)
|
||||||
|
|
@ -103,8 +104,6 @@ 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
|
NONE-PREDS. If NARROW is non-nil, buffer will not be widened
|
||||||
first."
|
first."
|
||||||
;; Cache `org-today' so we don't have to run it repeatedly.
|
;; Cache `org-today' so we don't have to run it repeatedly.
|
||||||
(let (today)
|
|
||||||
(cl-letf ((today org-ql--today))
|
|
||||||
(org-ql--fmap ((category #'org-ql--category-p)
|
(org-ql--fmap ((category #'org-ql--category-p)
|
||||||
(date #'org-ql--date-plain-p)
|
(date #'org-ql--date-plain-p)
|
||||||
(deadline #'org-ql--deadline-p)
|
(deadline #'org-ql--deadline-p)
|
||||||
|
|
@ -127,7 +126,7 @@ first."
|
||||||
(outline-next-heading))
|
(outline-next-heading))
|
||||||
(cl-loop when (funcall pred)
|
(cl-loop when (funcall pred)
|
||||||
collect (org-element-headline-parser (line-end-position))
|
collect (org-element-headline-parser (line-end-position))
|
||||||
while (outline-next-heading))))))))
|
while (outline-next-heading))))))
|
||||||
|
|
||||||
;;;;; Predicates
|
;;;;; Predicates
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue