emacs-devel
[Top][All Lists]
Advanced

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

Re: disabling undo boundaries


From: Stefan Monnier
Subject: Re: disabling undo boundaries
Date: Thu, 06 Aug 2015 18:20:52 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> I think that the current undo-boundary behaviour wrt a single buffer
> makes sense. It's the fact that inserting content into *that* buffer
> forces an undo-boundary into *this* buffer.  I don't know why Emacs
> does this.

I think the reason is not very deep: for reasons of efficiency (back in
the days when 8MB was a lot of memory), Emacs keeps track of a few
undo-related pieces of information in global variables, so it can only
handle a single buffer at a time.  If a command touches some other
buffer, the C code has to choose between "just switch" and "push
a boundary and then switch", and the choice it makes is to err on the
"safe" side of adding a potentially unnecessary undo-boundary rather
than risking to let the undo-log grow without intervening boundaries.

In your cases, this is complicated by the fact that you're concerned
about self-insert-command which is very special in that it was the only
command that doesn't push a boundary every time, but only once every
N repetitions.


        Stefan



reply via email to

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