unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
Subject: *vc-diff* keeps undo information
Date: Thu, 1 Jun 2006 17:31:19 -0400	[thread overview]
Message-ID: <17535.23719.576201.366323@rgrjr.dyndns.org> (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

             reply	other threads:[~2006-06-01 21:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-01 21:31 Bob Rogers [this message]
2006-06-02  7:52 ` *vc-diff* keeps undo information 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17535.23719.576201.366323@rgrjr.dyndns.org \
    --to=rogers-emacs@rgrjr.dyndns.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).