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

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

[elpa] externals/undo-tree b15904c 023/195: Update timestamps when nodes


From: Stefan Monnier
Subject: [elpa] externals/undo-tree b15904c 023/195: Update timestamps when nodes are visited by undo/redo.
Date: Sat, 28 Nov 2020 13:41:13 -0500 (EST)

branch: externals/undo-tree
commit b15904cc61536cff2811982145cc3c7c75799ad6
Author: tsc25 <tsc25@cantab.net>
Commit: tsc25 <tsc25@cantab.net>

    Update timestamps when nodes are visited by undo/redo.
---
 undo-tree.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/undo-tree.el b/undo-tree.el
index 696ff6a..24c7128 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -895,6 +895,9 @@ as what it is: a tree."
       ;; rewind current node
       (setf (undo-tree-current buffer-undo-tree)
            (undo-tree-node-previous (undo-tree-current buffer-undo-tree)))
+      ;; update timestamp
+      (setf (undo-tree-node-timestamp (undo-tree-current buffer-undo-tree))
+           (current-time))
       ))
   ;; inform user if at branch point
   (when (> (undo-tree-num-branches) 1)
@@ -924,6 +927,8 @@ as what it is: a tree."
              (setf (undo-tree-current buffer-undo-tree)
                    (nth (undo-tree-node-branch current)
                         (undo-tree-node-next current))))
+       ;; update timestamp
+       (setf (undo-tree-node-timestamp current) (current-time))
        ;; redo one record from undo tree
        (primitive-undo 1 (undo-copy-list (undo-tree-node-redo current)))
        ;; discard undo entries that `primitive-undo' has added to



reply via email to

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