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

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

[elpa] externals/undo-tree 85efe23 116/195: Ensure auto-compression-mode


From: Stefan Monnier
Subject: [elpa] externals/undo-tree 85efe23 116/195: Ensure auto-compression-mode is enabled when reading undo history file.
Date: Sat, 28 Nov 2020 13:41:34 -0500 (EST)

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

    Ensure auto-compression-mode is enabled when reading undo history file.
---
 undo-tree.el | 47 ++++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/undo-tree.el b/undo-tree.el
index 3a5cedf..471ae9f 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -3133,29 +3133,30 @@ signaling an error if file is not found."
               filename)))
     (let (buff tmp hash tree)
       (setq buff (current-buffer))
-      (with-temp-buffer
-       (insert-file-contents filename)
-       (goto-char (point-min))
-       (condition-case nil
-           (setq hash (read (current-buffer)))
-         (error
-          (kill-buffer nil)
-          (funcall (if noerror 'message 'error)
-                   "Error reading undo-tree history from \"%s\"" filename)
-          (throw 'load-error nil)))
-       (unless (string= (sha1 buff) hash)
-         (kill-buffer nil)
-         (funcall (if noerror 'message 'error)
-                  "Buffer has been modified; could not load undo-tree history")
-         (throw 'load-error nil))
-       (condition-case nil
-           (setq tree (read (current-buffer)))
-         (error
-          (kill-buffer nil)
-          (funcall (if noerror 'message 'error)
-                   "Error reading undo-tree history from \"%s\"" filename)
-          (throw 'load-error nil)))
-       (kill-buffer nil))
+      (with-auto-compression-mode
+       (with-temp-buffer
+         (insert-file-contents filename)
+         (goto-char (point-min))
+         (condition-case nil
+             (setq hash (read (current-buffer)))
+           (error
+            (kill-buffer nil)
+            (funcall (if noerror 'message 'error)
+                     "Error reading undo-tree history from \"%s\"" filename)
+            (throw 'load-error nil)))
+         (unless (string= (sha1 buff) hash)
+           (kill-buffer nil)
+           (funcall (if noerror 'message 'error)
+                    "Buffer has been modified; could not load undo-tree 
history")
+           (throw 'load-error nil))
+         (condition-case nil
+             (setq tree (read (current-buffer)))
+           (error
+            (kill-buffer nil)
+            (funcall (if noerror 'message 'error)
+                     "Error reading undo-tree history from \"%s\"" filename)
+            (throw 'load-error nil)))
+         (kill-buffer nil)))
       ;; initialise empty undo-tree object pool
       (setf (undo-tree-object-pool tree)
            (make-hash-table :test 'eq :weakness 'value))



reply via email to

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