unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Toby Cubitt <tsc25@cantab.net>
To: Barry OReilly <gundaetiapo@gmail.com>
Cc: 16523@debbugs.gnu.org
Subject: bug#16523: Undo Tree regression: (error "Unrecognized entry in undo list undo-tree-canary")
Date: Wed, 22 Jan 2014 17:08:44 +0000	[thread overview]
Message-ID: <20140122170844.GA1898@c3po> (raw)
In-Reply-To: <CAFM41H1iOvXcNWXV_7tB0houFo1r2FXXjm2133CiHBWGAGdVzA@mail.gmail.com>

On Tue, Jan 21, 2014 at 10:23:37PM -0500, Barry OReilly wrote:
> > * Sometimes the navigate down hangs with backtrace:
> >
> >   Debugger entered--Lisp error: (quit)
> >      undo-tree-copy-list((nil))
> >      undo-tree-redo-1(1)
> >      undo-tree-visualize-redo(1)
> >      call-interactively(undo-tree-visualize-redo nil nil)
> >      command-execute(undo-tree-visualize-redo)
> 
> In a reproduction of this, at the start of undo-tree-copy-list,
> undo-list is:
> 
>   (nil (undo-tree-id3 . -2))
> 
> Then in this while loop:
> 
>   (while (null copy)
>     (setq copy
>           (undo-tree-restore-GC-elts-from-pool (pop undo-list))))
> 
> undo-tree-restore-GC-elts-from-pool returns nil for both elements, so
> the while loop never ends. Perhaps you want instead (ignore-whitespace
> diff):

Could well be. Thanks a lot for the patch!

I need to step through the minimal example and remember what this code is
supposed to be doing, and then either apply your patch or figure out what
the correct fix is (to this, and the other undo-list-pop-changeset issue
you pointed out, which at the moment seem to be separate issues).

Cheers,
Toby


> --- a/emacs/lisp/undo-tree.el    Fri Jan 17 19:18:15 2014 -0500
> +++ b/emacs/lisp/undo-tree.el    Tue Jan 21 22:17:50 2014 -0500
> @@ -1690,13 +1690,13 @@
>  (defun undo-tree-copy-list (undo-list)
>    ;; Return a deep copy of first changeset in `undo-list'. Object id's are
>    ;; replaced by corresponding objects from `buffer-undo-tree' object-pool.
> -  (when undo-list
>      (let (copy p)
>        ;; if first element contains an object id, replace it with object
> from
>        ;; pool, discarding element entirely if it's been GC'd
> -      (while (null copy)
> +    (while (and undo-list (null copy))
>      (setq copy
>            (undo-tree-restore-GC-elts-from-pool (pop undo-list))))
> +    (when copy
>        (setq copy (list copy)
>          p copy)
>        ;; copy remaining elements, replacing object id's with objects from

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

email: tsc25@cantab.net
web:   www.dr-qubit.org





  reply	other threads:[~2014-01-22 17:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07  0:32 bug#16377: Undo Tree regression: (error "Unrecognized entry in undo list undo-tree-canary") Barry OReilly
2014-01-07  4:14 ` Toby Cubitt
2014-01-22  3:23   ` Barry OReilly
2014-01-22 17:08     ` Toby Cubitt [this message]
2014-01-08  3:37 ` Toby Cubitt
2014-01-22  0:05   ` Barry OReilly
     [not found]     ` <20140122141701.GA6728@c3po>
2014-01-22 15:26       ` Barry OReilly
2014-01-22 17:05         ` Toby Cubitt
2014-01-22 18:56           ` Stefan Monnier
2014-01-22 21:30             ` Toby Cubitt
2017-07-06  0:33 ` Keith David Bershatsky
2017-07-06  5:01 ` Keith David Bershatsky
2017-07-06  5:35   ` Stefan Monnier
2017-07-06  6:25 ` Keith David Bershatsky
2017-07-06  9:02   ` Toby Cubitt
2017-07-06  9:47     ` Toby Cubitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140122170844.GA1898@c3po \
    --to=tsc25@cantab.net \
    --cc=16523@debbugs.gnu.org \
    --cc=gundaetiapo@gmail.com \
    --cc=toby-dated-1391620129.532598@dr-qubit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).