[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vundo 8067005e53 56/58: Merge branch 'pr-remove-redunda
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vundo 8067005e53 56/58: Merge branch 'pr-remove-redundant-eqv-list-of' |
Date: |
Fri, 15 Apr 2022 12:58:16 -0400 (EDT) |
branch: externals/vundo
commit 8067005e5333129ccedbb6da04a5fb7e40f14106
Merge: 00e5c4e73c c44a2787ea
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
Merge branch 'pr-remove-redundant-eqv-list-of'
---
vundo.el | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/vundo.el b/vundo.el
index 9bb62d5527..6b92965392 100644
--- a/vundo.el
+++ b/vundo.el
@@ -363,6 +363,15 @@ modification in MOD-LIST. Return HASH-TABLE."
;; We know 3 and 5 are in the same equivalent list because 5 maps to 3
;; in `undo-equiv-table' (basically).
+(defun vundo--master-eqv-mod-of (mod)
+ "Return the master mod in the eqv-list of MOD.
+Master mod is the mod with the smallest index in the eqv-list.
+This function is equivalent to (car (vundo--eqv-list-of mod))."
+ (while (vundo-m-prev-eqv mod)
+ (cl-assert (not (eq mod (vundo-m-prev-eqv mod))))
+ (setq mod (vundo-m-prev-eqv mod)))
+ mod)
+
(defun vundo--eqv-list-of (mod)
"Return all the modifications equivalent to MOD."
(while (vundo-m-next-eqv mod)
@@ -439,8 +448,7 @@ If FROM non-nil, build from FORM-th modification in
MOD-LIST."
;; the child.
(unless (eq m 0)
(let* ((m-1 (aref mod-list (1- m)))
- ;; TODO: may need to optimize.
- (min-eqv-mod (car (vundo--eqv-list-of m-1))))
+ (min-eqv-mod (vundo--master-eqv-mod-of m-1)))
(setf (vundo-m-parent mod) min-eqv-mod)
(let ((children (vundo-m-children min-eqv-mod)))
;; If everything goes right, we should never encounter
@@ -703,7 +711,7 @@ This function modifies ‘vundo--prev-mod-list’,
(defun vundo--current-node (mod-list)
"Return the currently highlighted node in MOD-LIST."
- (car (vundo--eqv-list-of (aref mod-list (1- (length mod-list))))))
+ (vundo--master-eqv-mod-of (aref mod-list (1- (length mod-list)))))
(defun vundo--highlight-node (node)
"Highlight NODE as current node."
- [elpa] externals/vundo ac37626525 26/58: Fix test, (continued)
- [elpa] externals/vundo ac37626525 26/58: Fix test, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 8c0ff18e7f 32/58: * README.txt: Reword comparison., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo a66bb05062 35/58: Merge branch 'pr-evil-mode-disable', ELPA Syncer, 2022/04/15
- [elpa] externals/vundo aefb233005 34/58: Fix #9: Disable evil-mode in vundo-mode, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 81d126cfab 22/58: Fix vundo-stem-root and vundo-stem-end, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 429e3a2397 23/58: Format fix, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 42c8e4adc1 28/58: Remove nth in vundo--mod-list-from, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 00e5c4e73c 54/58: * vundo.el (vundo-mode): Avoid duplicates in evil-emacs-state-modes., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 6c15a96fb6 57/58: * test/vundo-test.el (vundo-test--3): Skip this test in batch mode., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 0e3af84944 47/58: Prepare for publish, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 8067005e53 56/58: Merge branch 'pr-remove-redundant-eqv-list-of',
ELPA Syncer <=
- [elpa] externals/vundo 2bb4bc8404 04/58: Fix nodes' face, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo a3e27e84f1 05/58: Add an option that controls the side on which we display vundo window, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 578a9f6be1 10/58: Update tests to accommodate read-only-ness, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo b996e201d8 12/58: * README.txt: Add notice, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo e136164f77 07/58: * vundo.el (vundo-next): move till end when asked to move too far, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 31b1491178 31/58: * README.txt: Add comparison., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 1737bcee28 18/58: Add vundo-compact-display, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 06de574d4f 24/58: Ignore position-only records when generating mod-list, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 6a408d000f 39/58: * vundo.el (vundo--check-for-command): Add declaration for edebug., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo ed0d7d42d8 38/58: Replace lists with vectors for the main vundo-m lists, ELPA Syncer, 2022/04/15