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

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

[elpa] externals/undo-tree 42aab056e3 6/9: Fix bug in detection of nodes


From: Stefan Monnier
Subject: [elpa] externals/undo-tree 42aab056e3 6/9: Fix bug in detection of nodes corresponding to unmodified buffers.
Date: Sat, 12 Mar 2022 18:02:56 -0500 (EST)

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

    Fix bug in detection of nodes corresponding to unmodified buffers.
---
 undo-tree.el | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/undo-tree.el b/undo-tree.el
index 04339438c9..e345d4c36f 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -1,10 +1,10 @@
 ;;; undo-tree.el --- Treat undo history as a tree  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2009-2020  Free Software Foundation, Inc
+;; Copyright (C) 2009-2021  Free Software Foundation, Inc
 
 ;; Author: Toby Cubitt <toby-undo-tree@dr-qubit.org>
 ;; Maintainer: Toby Cubitt <toby-undo-tree@dr-qubit.org>
-;; Version: 0.8.1
+;; Version: 0.8.2
 ;; Keywords: convenience, files, undo, redo, history, tree
 ;; Package-Requires: ((queue "0.2"))
 ;; URL: https://www.dr-qubit.org/undo-tree.html
@@ -2226,16 +2226,14 @@ which is defined in the `warnings' library.\n")
   ;; Return non-nil if NODE corresponds to a buffer state that once upon a
   ;; time was unmodified. If a file modification time MTIME is specified,
   ;; return non-nil if the corresponding buffer state really is unmodified.
-  (let (changeset ntime)
-    (setq changeset
+  (let* ((changeset
          (or (undo-tree-node-redo node)
              (and (setq changeset (car (undo-tree-node-next node)))
-                  (undo-tree-node-undo changeset)))
-         ntime
-         (catch 'found
-           (dolist (elt changeset)
-             (when (and (consp elt) (eq (car elt) t) (consp (cdr elt))
-                        (throw 'found (cdr elt)))))))
+                  (undo-tree-node-undo changeset))))
+        (ntime
+         (let ((elt (car (last changeset))))
+           (and (consp elt) (eq (car elt) t) (consp (cdr elt))
+                (cdr elt)))))
     (and ntime
         (or (null mtime)
             ;; high-precision timestamps



reply via email to

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