emacs-devel
[Top][All Lists]
Advanced

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

Re: guaranteed undo boundaries


From: Roland Winkler
Subject: Re: guaranteed undo boundaries
Date: Thu, 7 Feb 2013 08:52:48 -0600

On Thu Feb 7 2013 Stefan Monnier wrote:
> > Possibly this is already guaranteed, merely this could be spelled out
> > more explicitly in some docstring / the elisp manual. Possibly, I am
> > missing something else.
> 
> By default, undo boundaries are pushed after each command run by
> the user.  But every command/function is free to adjust this behavior by
> calling undo-boundary internally (or by removing the boundary, as does
> self-insert-command).
> 
> So there's no such guarantee.
> What you can do, OTOH, is something like
> 
>     (undo-boundary)
>     (let ((bottom buffer-undo-list))
>       <do-db-update>
>       (remove-all-boundaries-between buffer-undo-list bottom))

...where I need to come up with some sensible code for a new
function remove-all-boundaries-between.

Thanks, that strategy makes sense!

Roland



reply via email to

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