From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: undo in loaddefs.el buffer Date: Tue, 28 Dec 2004 15:57:51 -0500 Message-ID: References: <200412211414.iBLEEZ903426@raven.dms.auburn.edu> <200412211541.iBLFfBc03861@raven.dms.auburn.edu> <87llbonyup.fsf@jurta.org> <200412260206.iBQ26wG17970@raven.dms.auburn.edu> <41CEE3B8.9090600@swipnet.se> <200412270231.iBR2VDE19709@raven.dms.auburn.edu> <41CFE247.8090409@swipnet.se> <41D15CBE.8060105@swipnet.se> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1104267988 20762 80.91.229.6 (28 Dec 2004 21:06:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 28 Dec 2004 21:06:28 +0000 (UTC) Cc: juri@jurta.org, yamaoka@jpl.org, teirllm@dms.auburn.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 28 22:06:20 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CjOXr-0008AQ-00 for ; Tue, 28 Dec 2004 22:06:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CjOij-0006WR-FX for ged-emacs-devel@m.gmane.org; Tue, 28 Dec 2004 16:17:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CjOiJ-0006Uq-BI for emacs-devel@gnu.org; Tue, 28 Dec 2004 16:17:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CjOiG-0006SI-9l for emacs-devel@gnu.org; Tue, 28 Dec 2004 16:17:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CjOiF-0006Rc-UI for emacs-devel@gnu.org; Tue, 28 Dec 2004 16:17:03 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CjOWG-0006aM-OG for emacs-devel@gnu.org; Tue, 28 Dec 2004 16:04:40 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1CjOPf-0005uL-FI; Tue, 28 Dec 2004 15:57:54 -0500 Original-To: "Jan D." In-reply-to: <41D15CBE.8060105@swipnet.se> (jan.h.d@swipnet.se) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:31544 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:31544 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.")