summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Lord <phillip.lord@russet.org.uk>2015-11-17 17:14:13 +0000
committerPhillip Lord <phillip.lord@russet.org.uk>2015-11-17 17:14:13 +0000
commit0c808ecb36049f77b715abe552e8eb6a5c593316 (patch)
treeab570b0ff3f1b5f889886135f7a63922222affed
parent8ee6f96adee2335331caa6f5e6db938b172c4382 (diff)
downloademacs-fix/segfault-from-run-undoable-change.tar.gz
-rw-r--r--lisp/simple.el11
1 files changed, 10 insertions, 1 deletions
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.