X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/7d682e9777bb38860a5f73e380ae033b93ed44d9..3a2d33c03ac0213ab8ec4013e791d3b516f4e052:/packages/undo-tree/undo-tree.el diff --git a/packages/undo-tree/undo-tree.el b/packages/undo-tree/undo-tree.el index 166c0798a..cb8a230b4 100644 --- a/packages/undo-tree/undo-tree.el +++ b/packages/undo-tree/undo-tree.el @@ -1690,13 +1690,13 @@ Comparison is done with `eq'." (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