Fix org-ql--value-at returning org-ql-nil during cache miss

"org-ql--value-at" improperly returned "org-ql-nil" when "fn" returns
nil during a cache miss. All following calls to "org-ql--value-at",
however, would properly return "nil".
This commit is contained in:
Josh Moller-Mara 2019-12-22 05:35:14 +08:00
parent b9dfd7d93b
commit 04e8f42452

View file

@ -477,7 +477,9 @@ Values compared with `equal'."
org-ql-node-value-cache)) org-ql-node-value-cache))
(map-put value-cache fn new-value) (map-put value-cache fn new-value)
(puthash position value-cache position-cache) (puthash position value-cache position-cache)
new-value))) (pcase new-value
('org-ql-nil nil)
(_ new-value)))))
(defun org-ql--add-markers (element) (defun org-ql--add-markers (element)
"Return ELEMENT with Org marker text properties added. "Return ELEMENT with Org marker text properties added.