branch: externals/bufferlo
commit 466365f3db0e1092c1558e7642d93299f7f8a53e
Author: shipmints <shipmi...@gmail.com>
Commit: shipmints <shipmi...@gmail.com>

    Minor tweak to auto save timer to accommodate idleness
    
    We use a regular timer which works correctly as a one-shot timer which
    we reschedule, but we want to save only when idle. This change ensures
    saving either when the timer fires and the user is currently idle, or
    schedules the save ASAP when idle.
---
 bufferlo.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bufferlo.el b/bufferlo.el
index e7f456fa14..25d6dc5c7a 100644
--- a/bufferlo.el
+++ b/bufferlo.el
@@ -2787,8 +2787,9 @@ Specify NO-MESSAGE to inhibit the bookmark save status 
message."
   "Save active bufferlo bookmarks per an optional idle timer.
 `bufferlo-bookmarks-auto-save-idle-interval' is treated as a
 one-shot timer to prevent reentrancy."
-  (when (current-idle-time)
-    (bufferlo-bookmarks-save))
+  (if (current-idle-time)
+      (bufferlo-bookmarks-save)
+    (run-with-idle-timer 0.1 nil #'bufferlo-bookmarks-save))
   (bufferlo--bookmarks-auto-save-timer-maybe-start))
 
 (defun bufferlo-bookmarks-save (&optional all)

Reply via email to