[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/undo-tree e352286 131/195: Fix incompatiblity with newe
From: |
Stefan Monnier |
Subject: |
[elpa] externals/undo-tree e352286 131/195: Fix incompatiblity with newer high-resolution timestamps. |
Date: |
Sat, 28 Nov 2020 13:41:37 -0500 (EST) |
branch: externals/undo-tree
commit e352286c4107bb3303fa0dc9b6db71c8b151b7cc
Author: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Commit: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Fix incompatiblity with newer high-resolution timestamps.
---
undo-tree.el | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/undo-tree.el b/undo-tree.el
index e648bee..1ae7e70 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -2037,11 +2037,10 @@ which is defined in the `warnings' library.\n")
(undo-tree-root tree)))
-(defun undo-tree-node-saved-buffer-p (node &optional mtime)
- ;; Return non-nil if NODE corresponds to a saved buffer state (not
- ;; necessarily the current saved state). If a file modification time MTIME
- ;; is specified, also check that the changeset's modification time
- ;; corresponds to MTIME.
+(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.
(let (changeset ntime)
(setq changeset
(or (undo-tree-node-redo node)
@@ -2054,8 +2053,12 @@ which is defined in the `warnings' library.\n")
(throw 'found (cdr elt)))))))
(and ntime
(or (null mtime)
- (and (= (car ntime) (car mtime))
- (= (cdr ntime) (cadr mtime)))))))
+ ;; high-precision timestamps
+ (if (listp (cdr ntime))
+ (equal ntime mtime)
+ ;; old-style timestamps
+ (and (= (car ntime) (car mtime))
+ (= (cdr ntime) (cadr mtime))))))))
@@ -3387,9 +3390,10 @@ signaling an error if file is not found."
undo-tree-insert-face)
(list undo-tree-insert-face))))
(register (undo-tree-node-register node))
- (unmodified (and undo-tree-visualizer-parent-mtime
- (undo-tree-node-saved-buffer-p
- node undo-tree-visualizer-parent-mtime)))
+ (unmodified (if undo-tree-visualizer-parent-mtime
+ (undo-tree-node-unmodified-p
+ node undo-tree-visualizer-parent-mtime)
+ (undo-tree-node-unmodified-p node)))
node-string)
;; check node's register (if any) still stores appropriate undo-tree state
(unless (and register
@@ -3940,7 +3944,7 @@ spcified `saved', and a negative prefix argument specifies
(eq current (undo-tree-register-data-node r)))
;; saved state
(and (or (null x) (eq x 'saved))
- (undo-tree-node-saved-buffer-p current))
+ (undo-tree-node-unmodified-p current))
))))))
@@ -3975,7 +3979,7 @@ a negative prefix argument specifies `register'."
(eq current (undo-tree-register-data-node r)))
;; saved state
(and (or (null x) (eq x 'saved))
- (undo-tree-node-saved-buffer-p current))
+ (undo-tree-node-unmodified-p current))
))))))
- [elpa] externals/undo-tree f566beb 106/195: Add customization option allowing timestamps to be displayed by default, (continued)
- [elpa] externals/undo-tree f566beb 106/195: Add customization option allowing timestamps to be displayed by default, Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree f3e0d93 119/195: Remove ChangeLog section from package headers., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 36b341b 112/195: Cope better if undo boundary before undo-tree-canary is missing., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 98dbabd 125/195: Implement visualizer commands to redo/undo to branch/register., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 85efe23 116/195: Ensure auto-compression-mode is enabled when reading undo history file., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 181e84b 124/195: Minor bug fix and tweak to visualizer register display., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 0ba2d37 122/195: Fix bug in undo-tree-clear-visualizer-data., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 443d74c 111/195: Avoid triggering error when saving undo history when there's nothing to save., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 5d06288 130/195: Implement lazy undo-tree drawing in visualizer., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 4c14173 115/195: Fix undo history auto-saving., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree e352286 131/195: Fix incompatiblity with newer high-resolution timestamps.,
Stefan Monnier <=
- [elpa] externals/undo-tree 0ba9a0f 134/195: Bump version number., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 17d2dee 141/195: Switch order of diff comparision in diff display., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree ffb7c02 140/195: Set inhibit-read-only when creating diff view., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree b2c020f 138/195: Fix defadvice code snippet in commentary., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree a041902 142/195: Fix inverted key bindings., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree f726f6e 149/195: Don't restore undo history from file when reverting buffer., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree d0273ec 144/195: Make undo-tree-visualizer-[undo|redo]-to-x work in selection mode., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree d0e8793 145/195: Fix diff after undo-tree-visualize-[undo|redo]-to-x in selection mode., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 7d12602 150/195: Fix formatting bug in absolute timestamps., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 01b4a86 151/195: Update comment about Emacs version required for persistent history., Stefan Monnier, 2020/11/28