From 011c4feaaac89297e3c8d3a3fd6f038758da3ea8 Mon Sep 17 00:00:00 2001 From: Benson Chu Date: Fri, 17 Mar 2023 17:20:38 -0500 Subject: [PATCH] CAN I HAVE A MOMENT TO BREATH BEFORE YOU START ASKING ME QUESTIONS --- lisp/git-auto-sync/my-org-autosync.el | 1 - lisp/ti-config/work-org-autosync.el | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/git-auto-sync/my-org-autosync.el b/lisp/git-auto-sync/my-org-autosync.el index cf0b6a5..e82082c 100644 --- a/lisp/git-auto-sync/my-org-autosync.el +++ b/lisp/git-auto-sync/my-org-autosync.el @@ -157,7 +157,6 @@ (timer-event-handler timer)) (remhash k gac--debounce-timers))) - (when (not noninteractive) (when my/puppet-p (add-to-list 'emacs-startup-hook diff --git a/lisp/ti-config/work-org-autosync.el b/lisp/ti-config/work-org-autosync.el index 4bb9122..6ea8c9f 100644 --- a/lisp/ti-config/work-org-autosync.el +++ b/lisp/ti-config/work-org-autosync.el @@ -69,6 +69,9 @@ (setq gac-default-message #'gac-commit-message) +(defun my/gac--wait-for-idle (buffer) + (run-with-idle-timer 5 nil #'gac--after-save buffer)) + (defun my/gac--debounced-save () (let* ((actual-buffer (current-buffer))) (when-let (current-timer (gethash actual-buffer gac--debounce-timers)) @@ -76,7 +79,7 @@ (cancel-timer current-timer)) (puthash actual-buffer (run-at-time gac-debounce-interval nil - #'gac--after-save + #'my/gac--wait-for-idle actual-buffer) gac--debounce-timers)))