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

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

[elpa] externals/undo-tree bdfd73f 132/195: Ignore bogus buffer modifica


From: Stefan Monnier
Subject: [elpa] externals/undo-tree bdfd73f 132/195: Ignore bogus buffer modification entries in undo changesets.
Date: Sat, 28 Nov 2020 13:41:37 -0500 (EST)

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

    Ignore bogus buffer modification entries in undo changesets.
    
    Some Emacs 24.x versions seem to occasionally produce buffer modification
    entries of the form (t . <n>) instead of the documented (t <h> . <l>) form,
    where <n> can even take nonsensical values such as -1.
---
 undo-tree.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/undo-tree.el b/undo-tree.el
index 1ae7e70..0244053 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2009-2012  Free Software Foundation, Inc
 
 ;; Author: Toby Cubitt <toby-undo-tree@dr-qubit.org>
-;; Version: 0.6
+;; Version: 0.6.1
 ;; Keywords: convenience, files, undo, redo, history, tree
 ;; URL: http://www.dr-qubit.org/emacs.php
 ;; Repository: http://www.dr-qubit.org/git/undo-tree.git
@@ -2040,7 +2040,7 @@ which is defined in the `warnings' library.\n")
 (defun undo-tree-node-unmodified-p (node &optional mtime)
   ;; 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 buffer state really is unmodified.
+  ;; return non-nil if the corresponding buffer state really is unmodified.
   (let (changeset ntime)
     (setq changeset
          (or (undo-tree-node-redo node)
@@ -2049,7 +2049,7 @@ which is defined in the `warnings' library.\n")
          ntime
          (catch 'found
            (dolist (elt changeset)
-             (when (and (consp elt) (eq (car elt) t)
+             (when (and (consp elt) (eq (car elt) t) (consp (cdr elt))
                         (throw 'found (cdr elt)))))))
     (and ntime
         (or (null mtime)



reply via email to

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