(fix)db: fix node caching (#2006)

Previously node caching used org-map-entries: this only mapped over agenda
entries, hence skipping various nodes. Instead, we should be using
org-map-region, which maps over the entire file.
This commit is contained in:
Jethro Kuan
2021-12-15 16:48:44 +08:00
committed by GitHub
parent b6d59e2238
commit 7ad5572741

View File

@ -338,12 +338,12 @@ If UPDATE-P is non-nil, first remove the file in the database."
(defun org-roam-db-map-nodes (fns)
"Run FNS over all nodes in the current buffer."
(org-with-point-at 1
(org-map-entries
(lambda ()
(when (org-roam-db-node-p)
(dolist (fn fns)
(funcall fn)))))))
(org-map-region
(lambda ()
(when (org-roam-db-node-p)
(dolist (fn fns)
(funcall fn))))
(point-min) (point-max)))
(defun org-roam-db-map-links (fns)
"Run FNS over all links in the current buffer."