Subject: Re: bug#16377: Undo Tree regression: (error "Unrecognized entry in undo list undo-tree-canary")

From: Toby Cubitt <[email-masked]>
Date: Wed, 22 Jan 2014 21:30:34 +0000

On Wed, Jan 22, 2014 at 01:56:12PM -0500, Stefan Monnier wrote:
> > Are there circumstances in which `primitive-undo' doesn't add to
> > `buffer-undo-list'?
> 
> Of course: if there are no changes until the next undo boundary, then
> primitive-undo just doesn't do anything other than pop that
> undo boundary.
> And primitive-undo doesn't add any boundary, so it can end up with no
> change at all to buffer-undo-list.

Makes sense.

This shouldn't happen in undo-tree, since normally it should only call
`primitive-undo' on a non-empty undo changeset...except it's just
possible that undo-tree's undo-in-region could add empty changesets to
buffer-undo-tree under some circumstances. Which might explain why this
error is triggered by undo-in-region, but not in normal undo-tree usage.

I'll investigate when I have time. In any case, it seems clear to me that
it's an existing undo-tree bug that's been brought to light by the new
error checking, rather than breakage from the new `primitive-undo'
implementation. So the ball's in my court.

Toby
-- 
Dr T. S. Cubitt
Royal Society University Research Fellow
and Fellow of Churchill College, Cambridge
Centre for Quantum Information
DAMTP, University of Cambridge

email: [email-masked]
web:   www.dr-qubit.org