[Top][All Lists]

[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: Sun, 10 May 2015 21:42:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> I am wondering why the "nil" undo-boundaries get inserted when I change
> *a different* buffer. This does not really make sense to me, and is
> causing breakage in my package.

The 3 separate undo entries you're seeing are actually the "normal"
outcome (one undo-boundary per buffer-modifying command).

self-insert-command has special ad-hoc code to try and merge sequences
of single-char insertions by removing the previous undo-boundary.
Which is why you normally only see a single undo entry.

In your second case, I suspect that this ad-hoc code doesn't get to do
what it's intended to do, because it does not recognize the
undo-boundary that is candidate for removal as being "an undo-boundary
we've auto-inserted".  So, self-insert-command thinks that this
undo-boundary may have been inserted by an explicit call to
`undo-boundary' at the end of the previous command, in which case it
should not be removed.

The relevant code is in the remove_excessive_undo_boundaries function,
in src/cmds.c.


reply via email to

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