(fix): save-restriction for db update (#1016)

This commit is contained in:
Jethro Kuan 2020-08-09 12:06:34 +08:00 committed by GitHub
parent c437052b4b
commit 6d03e7626d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -455,17 +455,15 @@ connections, nil is returned."
(find-file-noselect file-path t))
(current-buffer))))
(with-current-buffer buf
(save-excursion
(save-restriction
(widen)
(emacsql-with-transaction (org-roam-db)
(org-roam-db--update-meta)
(org-roam-db--update-tags)
(org-roam-db--update-titles)
(org-roam-db--update-refs)
(org-roam-db--update-headlines)
(org-roam-db--update-links)))
(org-roam-buffer--update-maybe :redisplay t))))))
(org-with-wide-buffer
(emacsql-with-transaction (org-roam-db)
(org-roam-db--update-meta)
(org-roam-db--update-tags)
(org-roam-db--update-titles)
(org-roam-db--update-refs)
(org-roam-db--update-headlines)
(org-roam-db--update-links)))
(org-roam-buffer--update-maybe :redisplay t)))))
(defun org-roam-db-build-cache (&optional force)
"Build the cache for `org-roam-directory'.