From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: *vc-diff* keeps undo information Date: Fri, 02 Jun 2006 18:39:04 -0400 Message-ID: References: <17535.23719.576201.366323@rgrjr.dyndns.org> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1149288006 8293 80.91.229.2 (2 Jun 2006 22:40:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Jun 2006 22:40:06 +0000 (UTC) Cc: spiegel@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 03 00:40:01 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FmIJ4-0002CN-Pp for ged-emacs-devel@m.gmane.org; Sat, 03 Jun 2006 00:39:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FmIJ4-0005Ak-6L for ged-emacs-devel@m.gmane.org; Fri, 02 Jun 2006 18:39:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FmIIM-0004ol-O6 for emacs-devel@gnu.org; Fri, 02 Jun 2006 18:39:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FmIIM-0004nw-4d for emacs-devel@gnu.org; Fri, 02 Jun 2006 18:39:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FmIIL-0004nj-Le for emacs-devel@gnu.org; Fri, 02 Jun 2006 18:39:05 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FmIOu-0005dN-GF for emacs-devel@gnu.org; Fri, 02 Jun 2006 18:45:52 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1FmIIK-0003xL-Fl; Fri, 02 Jun 2006 18:39:04 -0400 Original-To: Bob Rogers In-reply-to: <17535.23719.576201.366323@rgrjr.dyndns.org> (message from Bob Rogers on Thu, 1 Jun 2006 17:31:19 -0400) 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: news.gmane.org gmane.emacs.devel:55640 Archived-At: Can someone call buffer-disable-undo in the *vc-diff* buffer when it is created? Date: Thu, 1 Jun 2006 17:31:19 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii From: Bob Rogers To: emacs-devel@gnu.org Subject: *vc-diff* keeps undo information X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=failed version=3.0.4 Primarily, the "undo" history consists of (erase-buffer) followed by insertion of diff output. Even emacs 21.3 allows me to undo/redo through the complete "history" of diffs. Is this a feature?!? I would argue the contrary. Besides being wasteful of memory, other "undo" behavior sometimes gets in the way. Here's what happens if you ever create a large diff: 1. "emacs -Q" 2. Visit a file under version control. 3. Make it some 3MB larger, possibly by inserting it into itself repeatedly. The goal is to make the resulting vc-diff buffer output at least 3MB. 3. "C-x v =" to make the *vc-diff* buffer appear for the first time. 4. "C-x o C-x v =" to replace the *vc-diff* buffer contents. You will be prompted with something like: Buffer `*vc-diff*' undo info is 3001370 bytes long; discard it? (yes or no) This strikes me as an odd question, as I thought I had already implicitly requested that the buffer be completely trashed by "C-x v =". (But then, I never knew I could undo these . . . ) The patch below is sufficient to get rid of undo in *vc-diff*, but is very much suboptimal, since it happens after all the diffing is done. Furthermore, it doesn't allow users to undo manual edits made afterwards, e.g. splitting hunks, which is surely unacceptable. I'd be happy to do a better job, but I haven't had a chance to sign copyright papers, and the result might not be considered "trivial" . . . But I expect this issue also affects other applications of diff-mode, and therefore requires a wider policy decision in any case. -- Bob Rogers http://rgrjr.dyndns.org/ ------------------------------------------------------------------------ Index: lisp/vc.el =================================================================== RCS file: /sources/emacs/emacs/lisp/vc.el,v retrieving revision 1.418 diff -c -r1.418 vc.el *** lisp/vc.el 13 Apr 2006 13:35:55 -0000 1.418 --- lisp/vc.el 1 Jun 2006 20:38:27 -0000 *************** *** 1789,1794 **** --- 1789,1795 ---- ;; buffer should affect the diff command. (vc-diff-internal file rev1 rev2)) (set-buffer "*vc-diff*") + (buffer-disable-undo) (if (and (zerop (buffer-size)) (not (get-buffer-process (current-buffer)))) (progn _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel