From 0c808ecb36049f77b715abe552e8eb6a5c593316 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Tue, 17 Nov 2015 17:14:13 +0000 Subject: Move to idle timer. --- lisp/simple.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 3d933134b88..bfb8212992a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2867,7 +2867,16 @@ REASON describes the reason that the boundary is being added; see "Ensure that the `undo-auto-boundary-timer' is set." (unless undo-auto--current-boundary-timer (setq undo-auto--current-boundary-timer - (run-at-time 10 nil #'undo-auto--boundary-timer)))) + (run-with-idle-timer 10 t + #'undo-auto--boundary-timer)))) + +(defun undo-auto--boundary-post-command-hook () + (remove-hook 'post-command-hook + #'undo-auto--boundary-post-command-hook) + (undo-auto--boundary-ensure-timer)) + +(add-hook 'post-command-hook + #'undo-auto--boundary-post-command-hook) ;; (defvar undo-auto--undoably-changed-buffers nil ;; "List of buffers that have changed recently. -- cgit v1.2.1