[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 27e3bbb 201/310: Reuse initial ediff session for al
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 27e3bbb 201/310: Reuse initial ediff session for all chunks. |
Date: |
Sat, 28 Nov 2020 00:33:15 -0500 (EST) |
branch: externals/vlf
commit 27e3bbb32038736866a5084ca2246584883b884c
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Reuse initial ediff session for all chunks.
---
vlf-ediff.el | 57 +++++++++++++++++++++++++++++++--------------------------
1 file changed, 31 insertions(+), 26 deletions(-)
diff --git a/vlf-ediff.el b/vlf-ediff.el
index 6e82c57..262a202 100644
--- a/vlf-ediff.el
+++ b/vlf-ediff.el
@@ -59,7 +59,11 @@ respectively of difference list, runs ediff over the
adjacent chunks."
(setq buffer-B (current-buffer))
(setq vlf-batch-size vlf-size))
(vlf-beginning-of-file)
- (vlf-ediff-next buffer-A buffer-B 'vlf-next-chunk))
+ (vlf-ediff-next buffer-A buffer-B 'vlf-next-chunk)
+ (ediff-buffers buffer-A buffer-B
+ '((lambda () (setq vlf-ediff-session t)
+ (if (< 0 ediff-number-of-differences)
+ (ediff-jump-to-difference 1))))))
;;;###autoload
(defun vlf-ediff-files (file-A file-B batch-size)
@@ -107,7 +111,7 @@ respectively of difference list, runs ediff over the
adjacent chunks."
(vlf-move-to-chunk new-start (+ new-start vlf-batch-size) t)))
(defun vlf-ediff-next (buffer-A buffer-B &optional next-func)
- "Activate ediff over the next difference in BUFFER-A and BUFFER-B.
+ "Find next pair of chunks that differ in BUFFER-A and BUFFER-B.
NEXT-FUNC is used to jump to the next logical chunks in case there is
no difference at the current ones."
(set-buffer buffer-A)
@@ -118,8 +122,8 @@ no difference at the current ones."
(min-file-size vlf-file-size)
(is-forward (eq next-func 'vlf-next-chunk)))
(set-buffer buffer-B)
- (setq buffer-B (current-buffer))
- (setq min-file-size (min min-file-size vlf-file-size))
+ (setq buffer-B (current-buffer)
+ min-file-size (min min-file-size vlf-file-size))
(let ((end-B (= vlf-start-pos vlf-end-pos))
(reporter (make-progress-reporter
"Searching for difference..."
@@ -154,44 +158,45 @@ no difference at the current ones."
max-file-size)))
(t (vlf-beginning-of-file)
(set-buffer buffer-A)
- (vlf-beginning-of-file))))
- (ediff-buffers buffer-A buffer-B
- `((lambda () (setq vlf-ediff-session t)
- (if (< 0 ediff-number-of-differences)
- (ediff-jump-to-difference
- ,(if is-forward 1 -1))))))))
+ (vlf-beginning-of-file))))))
(defadvice ediff-next-difference (around vlf-ediff-next-difference
compile activate)
- "Quit ediff session, move to the next VLF chunk and search for\
-difference if at the end of difference list."
+ "Move to the next VLF chunk and search for difference if at the end\
+of difference list."
(if (and vlf-ediff-session
(<= (1- ediff-number-of-differences)
ediff-current-difference))
(let ((buffer-A ediff-buffer-A)
(buffer-B ediff-buffer-B))
- (ediff-really-quit nil)
- (set-buffer buffer-A)
- (vlf-next-chunk)
- (set-buffer buffer-B)
- (vlf-next-chunk)
- (vlf-ediff-next buffer-A buffer-B 'vlf-next-chunk))
+ (save-excursion
+ (set-buffer buffer-A)
+ (vlf-next-chunk)
+ (set-buffer buffer-B)
+ (vlf-next-chunk)
+ (vlf-ediff-next buffer-A buffer-B 'vlf-next-chunk))
+ (ediff-update-diffs)
+ (if (< 0 ediff-number-of-differences)
+ (ediff-jump-to-difference 1)))
ad-do-it))
(defadvice ediff-previous-difference (around vlf-ediff-prev-difference
compile activate)
- "Quit ediff session, move to the previous VLF chunk and search for\
-difference if at the beginning of difference list."
+ "Move to the previous VLF chunk and search for difference if at the\
+beginning of difference list."
(if (and vlf-ediff-session
(<= ediff-current-difference 0))
(let ((buffer-A ediff-buffer-A)
(buffer-B ediff-buffer-B))
- (ediff-really-quit nil)
- (set-buffer buffer-A)
- (vlf-prev-chunk)
- (set-buffer buffer-B)
- (vlf-prev-chunk)
- (vlf-ediff-next buffer-A buffer-B 'vlf-prev-chunk))
+ (save-excursion
+ (set-buffer buffer-A)
+ (vlf-prev-chunk)
+ (set-buffer buffer-B)
+ (vlf-prev-chunk)
+ (vlf-ediff-next buffer-A buffer-B 'vlf-prev-chunk))
+ (ediff-update-diffs)
+ (if (< 0 ediff-number-of-differences)
+ (ediff-jump-to-difference -1)))
ad-do-it))
(provide 'vlf-ediff)
- [elpa] externals/vlf ca56498 259/310: Change vlf-tune-get-optimal to optimize on total time of primitive, (continued)
- [elpa] externals/vlf ca56498 259/310: Change vlf-tune-get-optimal to optimize on total time of primitive, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 51d95ec 152/310: Add command to display batch starting from point., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 46e39a0 153/310: Version 1.0., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d1af56d 167/310: Fix opening of files for GNU Emacs 23., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 8ab1c6a 136/310: Disable undo and mark buffer as not modified when invoking search or, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf bb482f0 173/310: Fix file size determination for symbolic links., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9ffb968 172/310: Remove defadvice abort-if-file-too-large argument list so it works, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 386d856 179/310: Restore undo information after temporarily disabling it., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf deec75d 186/310: Enlarge minimum sample chunk for decoding size., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 516584e 187/310: Break VLF into components., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 27e3bbb 201/310: Reuse initial ediff session for all chunks.,
Stefan Monnier <=
- [elpa] externals/vlf 9343095 193/310: Fix installation interfile dependencies and fix setting of local, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 88dba8b 195/310: Remove unnecessary addition to load-path on compile., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf dd43af5 192/310: Manually decode and use several bytes buffer when loading chunk., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 98ddc3a 198/310: Add by batch Ediff functionality., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9646b00 202/310: Adjust chunk borders to minimize shift differences and optimize, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d5d9cd7 205/310: Improve refining of differences and readjustment., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0fa8e8d 210/310: Update buffer name on user interruption during ediff., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 30d2bb0 208/310: VLF buffer ediff now starts from the current chunks., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f83a212 213/310: Temporarily disable font-lock during multiple batch operations., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 074f9e9 221/310: Play nicely with hexl-mode., Stefan Monnier, 2020/11/28