[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Undo discard prompt

From: Stefan Monnier
Subject: Re: Undo discard prompt
Date: Wed, 26 Jan 2005 10:00:45 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

>     Well I didn't say "routinely": it happened 4 times until now.
>     And I don't think they were the result of a bug.  They mostly (3 times)
>     occured because I did something like:
>     1 - copy a large file (or a buffer).
>     2 - work on the copy by removing most of its content.

> I can see why #2 could put a lot of information in the undo list.  But
> why would this make the undo list for one single command very large?

Think of a big log, and then a kbd macro that removes things between the
lines that match a regexp (similar to what `occur' does).  Some of the
chunks removed were probably more than 1MB.

>     The remaining case occured in conjunction with the command
>     diff-context->unified on a large patch file.  Maybe the command
>     shouldn't keep the undo info, but I find that I do undo this command.

> It makes sense for this command to be undoable.  Indeed, for a big
> enough file, it would trigger this question.

> I wonder if the command is written in a way that produces
> unnecessarily large bulk of undo info.  Perhaps some simple changes
> would reduce the size of its undo info by a factor of 2.
> This, combined with increasing the default value of undo-outer-limit,
> would make such questions very rare.

Could be.  But I have better things to do than to try and chase
a factor-of-2 improvement to try and avoid a prompt that I just don't ever
want to see.

Large undo steps are rare, but they do occur.  Basically for the same reason
that people rarely edit large files, but they do sometimes bump into the
256MB limit.  The main problem I see with the current prompt is that large
undo steps mostly occur when doing "batch" editing (e.g. kbd-macros) where
prompting the user is a bad idea.  I'd say, bump the limit up to at least
a couple MBs, and turn the prompt into a warning (and forcibly throw away
the undo, or maybe save it to a file before throwing it away).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]