[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: undo in loaddefs.el buffer
From: |
Richard Stallman |
Subject: |
Re: undo in loaddefs.el buffer |
Date: |
Tue, 28 Dec 2004 15:57:51 -0500 |
Now I understand the problem. Does this fix it?
*** 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.")
- Re: undo in loaddefs.el buffer, (continued)
- Re: undo in loaddefs.el buffer, Richard Stallman, 2004/12/26
- Re: undo in loaddefs.el buffer, Jan D., 2004/12/26
- Re: undo in loaddefs.el buffer, Luc Teirlinck, 2004/12/26
- Re: undo in loaddefs.el buffer, Jan D., 2004/12/27
- Re: undo in loaddefs.el buffer, Jan D., 2004/12/27
- Re: undo in loaddefs.el buffer, Richard Stallman, 2004/12/27
- Re: undo in loaddefs.el buffer, Jan D., 2004/12/28
- Re: undo in loaddefs.el buffer,
Richard Stallman <=
- Re: undo in loaddefs.el buffer, Jan D., 2004/12/29
- Re: undo in loaddefs.el buffer, Luc Teirlinck, 2004/12/28
- Re: undo in loaddefs.el buffer, Richard Stallman, 2004/12/28
- Re: undo in loaddefs.el buffer, Luc Teirlinck, 2004/12/28
- Re: undo in loaddefs.el buffer, Richard Stallman, 2004/12/29
- Re: undo in loaddefs.el buffer, Luc Teirlinck, 2004/12/29
- Re: undo in loaddefs.el buffer, Richard Stallman, 2004/12/30
- Re: undo in loaddefs.el buffer, Luc Teirlinck, 2004/12/30
- Re: undo in loaddefs.el buffer, David Kastrup, 2004/12/31
- Re: undo in loaddefs.el buffer, Luc Teirlinck, 2004/12/31