# HG changeset patch # User Richard M. Stallman # Date 1103629072 0 # Node ID f6e8a2dc456a67002ca6e2fdca80ca6b3424487d # Parent a32a0ec1c9aca9644bc30a035421dae7ec050e85 (undo-outer-limit-truncate): New function. (undo-outer-limit-function): Use undo-outer-limit-truncate. diff -r a32a0ec1c9ac -r f6e8a2dc456a lisp/simple.el --- a/lisp/simple.el Tue Dec 21 11:37:25 2004 +0000 +++ b/lisp/simple.el Tue Dec 21 11:37:52 2004 +0000 @@ -1484,6 +1484,17 @@ (t '(0 . 0))) '(0 . 0))) + +;; When the first undo batch in an undo list is longer than undo-outer-limit, +;; this function gets called to ask the user what to do. +;; Garbage collection is inhibited around the call, +;; so it had better not do a lot of consing. +(setq undo-outer-limit-function 'undo-outer-limit-truncate) +(defun undo-outer-limit-truncate (size) + (if (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " + (buffer-name) size)) + (progn (setq buffer-undo-list nil) t) + nil)) (defvar shell-command-history nil "History list for some commands that read shell commands.")