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

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

[elpa] externals/undo-tree ca9ec7b 105/195: Clear visualizer data / kill


From: Stefan Monnier
Subject: [elpa] externals/undo-tree ca9ec7b 105/195: Clear visualizer data / kill visualizer before saving history.
Date: Sat, 28 Nov 2020 13:41:31 -0500 (EST)

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

    Clear visualizer data / kill visualizer before saving history.
    
    Otherwise markers in visualizer meta-data cause read errors when loading
    history.
---
 undo-tree.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/undo-tree.el b/undo-tree.el
index b1395b3..35033a9 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -647,6 +647,9 @@
 ;; * use a function `undo-tree-make-history-save-file-name' function to
 ;;   generate history save filename, allowing save file to be customized by
 ;;   overriding this function
+;; * clear visualizer data / kill visualizer in `undo-tree-save-history'
+;;   before saving history to file, otherwise markers in visualizer meta-data
+;;   cause read errors in `undo-tree-load-history'
 ;;
 ;; Version 0.4
 ;; * implemented persistent history storage: `undo-tree-save-history' and
@@ -2892,6 +2895,9 @@ Otherwise, prompt for one.
 If OVERWRITE is non-nil, any existing file will be overwritten
 without asking for confirmation."
   (interactive)
+  (condition-case nil
+      (undo-tree-kill-visualizer)
+    (error (undo-tree-clear-visualizer-data buffer-undo-tree)))
   (undo-list-transfer-to-tree)
   (let ((buff (current-buffer))
        (tree (copy-undo-tree buffer-undo-tree)))



reply via email to

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