From 42e1100b0e99bf91b532d7e06d246a2f2660d853 Mon Sep 17 00:00:00 2001 From: stardiviner Date: Fri, 6 Sep 2024 18:18:52 +0800 Subject: [PATCH] Disable the Emacs idle timer of org-bookmarks auto update database by default --- org-bookmarks.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/org-bookmarks.el b/org-bookmarks.el index 25e9e83..d27f6d6 100644 --- a/org-bookmarks.el +++ b/org-bookmarks.el @@ -102,6 +102,12 @@ Or you can add org-capture template by yourself." :safe #'booleanp :group 'org-bookmarks) +(defcustom org-bookmarks-db-auto-update-when-idle nil + "Non-nil means auto update org-bookmarks database when Emacs idle." + :type 'boolean + :safe #'booleanp + :group 'org-bookmarks) + (defun org-bookmarks--entry-screenshot (headline) "Return the bookmark HEADLINE object's webpage screenshot inline image." @@ -206,7 +212,8 @@ Or you can add org-capture template by yourself." :safe #'numberp :group 'org-bookmarks) -(run-with-idle-timer org-bookmarks-db-update-idle-interval t 'org-bookmarks-db-update-cache) +(when org-bookmarks-db-auto-update-when-idle + (run-with-idle-timer org-bookmarks-db-update-idle-interval t 'org-bookmarks-db-update-cache)) ;;;###autoload (defun org-bookmarks (&optional file) -- 2.11.4.GIT