]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix bug that caused undo-tree to hang when undoing in region (bug#16377).
authorBarry O'Reilly <boreilly@aer.com>
Thu, 1 May 2014 20:42:52 +0000 (16:42 -0400)
committerBarry O'Reilly <boreilly@aer.com>
Thu, 1 May 2014 20:42:52 +0000 (16:42 -0400)
packages/undo-tree/undo-tree.el

index 166c0798a152195eb177d6110cda2691c3f65bc2..cb8a230b415789fb7a03c23a29c3cbc5f9900025 100644 (file)
@@ -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