From feda1f41e55a36bc93972783f93cf7380c629883 Mon Sep 17 00:00:00 2001 From: carlos Date: Tue, 22 Sep 2020 15:10:43 +0800 Subject: [PATCH] (feat): extract idle timer interval as a customizable value (#1122) Co-authored-by: Jethro Kuan --- org-roam.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org-roam.el b/org-roam.el index 1cea502..8623c00 100644 --- a/org-roam.el +++ b/org-roam.el @@ -113,6 +113,11 @@ If nil, `find-file' is used." :type 'function :group 'org-roam) +(defcustom org-roam-update-db-idle-seconds 2 + "Number of idle seconds before triggering an Org-roam database update." + :type 'integer + :group 'org-roam) + (defcustom org-roam-include-type-in-ref-path-completions nil "When t, include the type in ref-path completions. Note that this only affects interactive calls. @@ -1716,7 +1721,7 @@ M-x info for more information at Org-roam > Installation > Post-Installation Tas (add-hook 'org-open-at-point-functions #'org-roam-open-id-at-point) (add-hook 'org-open-link-functions #'org-roam--open-fuzzy-link) (unless org-roam--file-update-timer - (setq org-roam--file-update-timer (run-with-idle-timer 2 t #'org-roam--process-update-queue))) + (setq org-roam--file-update-timer (run-with-idle-timer org-roam-update-db-idle-seconds t #'org-roam--process-update-queue))) (advice-add 'rename-file :after #'org-roam--rename-file-advice) (advice-add 'delete-file :before #'org-roam--delete-file-advice) (when (fboundp 'org-link-set-parameters)