Skip to content

Commit 890c247

Browse files
committed
Docs: (defpred.org) Fix macro example
Thanks to Pete Kazmier (@pkazmier) for reporting (see issue #152).
1 parent 6e6f62d commit 890c247

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

examples/defpred.org

+15-2
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,24 @@ Finally, if you're a Lisper who appreciates anaphora, you might prefer a more sy
331331
(org-ql-defpred (person p) (&rest names)
332332
"Search for entries about any of NAMES."
333333
:normalizers ((`(,predicate-names . ,names)
334-
`(or (tags ,@(--map `(concat "person" ,it) names))
334+
`(or (tags ,@(--map (concat "person" it) names))
335335
,@(--map `(property "person" ,it) names)))))
336336
#+END_SRC
337337

338-
Let's make sure it works:
338+
Let's make sure it normalizes correctly:
339+
340+
#+BEGIN_SRC elisp :results code :exports both :cache yes
341+
(org-ql--normalize-query '(person "Alice" "Bob"))
342+
#+END_SRC
343+
344+
#+RESULTS[ebc46fff31b72359353dda539a26c95b7d650df2]:
345+
#+BEGIN_SRC elisp
346+
(or (tags "personAlice" "personBob")
347+
(property "person" "Alice")
348+
(property "person" "Bob"))
349+
#+END_SRC
350+
351+
It does, so the query also produces the correct results:
339352

340353
#+BEGIN_SRC elisp :results list :exports both :cache yes
341354
(org-ql-query :select '(org-get-heading :no-tags)

0 commit comments

Comments
 (0)