From 9ee591f7a46690f54b42f18f007d279c201e86c8 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Sun, 16 Aug 2020 12:08:19 +0800 Subject: [PATCH] (fix): fix possibility of multiple idle timers (#1042) This change ensures that `org-roam--file-update-timer` has only one instance per Emacs instance. Fixes #1037 --- org-roam.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org-roam.el b/org-roam.el index bc26a96..666ff79 100644 --- a/org-roam.el +++ b/org-roam.el @@ -1590,7 +1590,8 @@ M-x info for more information at Org-roam > Installation > Post-Installation Tas (add-hook 'kill-emacs-hook #'org-roam-db--close-all) (add-hook 'org-open-at-point-functions #'org-roam-open-id-at-point) (add-hook 'org-open-link-functions #'org-roam--open-fuzzy-link) - (setq org-roam--file-update-timer (run-with-idle-timer 2 t #'org-roam--process-update-queue)) + (unless org-roam--file-update-timer + (setq org-roam--file-update-timer (run-with-idle-timer 2 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)