*** simple.el 27 Dec 2004 20:52:25 -0500 1.676
--- simple.el 28 Dec 2004 13:49:15 -0500
***************
*** 1524,1540 ****
'(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 (let (use-dialog-box)
! (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.")
--- 1524,1556 ----
'(0 . 0)))
'(0 . 0)))
+ (defvar undo-extra-outer-limit nil
+ "If non-nil, an extra level of size that's ok in an undo item.
+ We don't ask the user about truncating the undo list until the
+ current item gets bigger than this amount.")
+ (make-variable-buffer-local 'undo-extra-outer-limit)
+
;; 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)
! (when (or (null undo-extra-outer-limit)
! (> size undo-extra-outer-limit))
! ;; Don't ask the question again unless it gets even bigger.
! ;; This applies, in particular, if the user quits from the
question.
! ;; Such a quit quits out of GC, but something else will call GC
! ;; again momentarily. It will call this function again,
! ;; but we don't want to ask the question again.
! (setq undo-extra-outer-limit (+ size 50000))
! (if (let (use-dialog-box)
! (yes-or-no-p (format "Buffer %s undo info is %d bytes long;
discard it? "
! (buffer-name) size)))
! (progn (setq buffer-undo-list nil)
! (setq undo-extra-outer-limit nil)
! t)
! nil)))
(defvar shell-command-history nil
"History list for some commands that read shell commands.")
_______________________________________________
Emacs-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-devel