emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] fix/segfault-from-run-undoable-change 0c808ec: Move to idl


From: Phillip Lord
Subject: [Emacs-diffs] fix/segfault-from-run-undoable-change 0c808ec: Move to idle timer.
Date: Tue, 17 Nov 2015 17:14:34 +0000

branch: fix/segfault-from-run-undoable-change
commit 0c808ecb36049f77b715abe552e8eb6a5c593316
Author: Phillip Lord <address@hidden>
Commit: Phillip Lord <address@hidden>

    Move to idle timer.
---
 lisp/simple.el |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 3d93313..bfb8212 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]