emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/undo-tree af99ee3 166/195: Uncoditionally clear visuali


From: Stefan Monnier
Subject: [elpa] externals/undo-tree af99ee3 166/195: Uncoditionally clear visualizer data before writing to file.
Date: Sat, 28 Nov 2020 13:41:45 -0500 (EST)

branch: externals/undo-tree
commit af99ee3302548596e67142992b44922fef4b3776
Author: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Commit: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>

    Uncoditionally clear visualizer data before writing to file.
    
    Should be cleared by killing the visualizer, but it writes unreadable data 
to
    file if something goes wrong and for some reason it isn't. So clearing
    unconditionally makes things marginally more robust (at the risk of masking
    bugs).
---
 undo-tree.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/undo-tree.el b/undo-tree.el
index 3ba84a1..b48f2dd 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -3085,9 +3085,10 @@ without asking for confirmation."
     (user-error "No undo information in this buffer"))
   (undo-list-transfer-to-tree)
   (when (and buffer-undo-tree (not (eq buffer-undo-tree t)))
-    (condition-case nil
-       (undo-tree-kill-visualizer)
-      (error (undo-tree-clear-visualizer-data buffer-undo-tree)))
+    (undo-tree-kill-visualizer)
+    ;; should be cleared already by killing the visualize, but writes
+    ;; unreasable data if not for some reason, so just in case...
+    (undo-tree-clear-visualizer-data buffer-undo-tree)
     (let ((buff (current-buffer))
          tree)
       ;; get filename



reply via email to

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