unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* *vc-diff* keeps undo information
@ 2006-06-01 21:31 Bob Rogers
  2006-06-02  7:52 ` Kim F. Storm
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Bob Rogers @ 2006-06-01 21:31 UTC (permalink / raw)


   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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-06-04  2:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-01 21:31 *vc-diff* keeps undo information Bob Rogers
2006-06-02  7:52 ` Kim F. Storm
2006-06-02  9:27 ` Juri Linkov
2006-06-02 22:39   ` Richard Stallman
2006-06-03 12:30     ` Thien-Thi Nguyen
2006-06-03 18:07       ` Bob Rogers
2006-06-04  2:23       ` Richard Stallman
2006-06-02 22:39 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).