[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 1a1ce27 212/310: Add progress reporters for the opt
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 1a1ce27 212/310: Add progress reporters for the optimized part of line search. |
Date: |
Sat, 28 Nov 2020 00:33:18 -0500 (EST) |
branch: externals/vlf
commit 1a1ce27d378526f1bf836d852ee5f5ed0edee9b9
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Add progress reporters for the optimized part of line search.
---
vlf-search.el | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/vlf-search.el b/vlf-search.el
index 495fa91..32ec2bd 100644
--- a/vlf-search.el
+++ b/vlf-search.el
@@ -198,28 +198,38 @@ Search is performed chunk by chunk in `vlf-batch-size'
memory."
(vlf-verify-size)
(setq start end
end (min vlf-file-size
- (+ start vlf-batch-size))))
+ (+ start vlf-batch-size)))
+ (progress-reporter-update reporter start))
+ (progress-reporter-done reporter)
(when (< n (- vlf-file-size end))
(vlf-move-to-chunk-2 start end)
(goto-char (point-min))
(setq success (vlf-re-search "[\n\C-m]" n nil 0)))))
(let ((start (max 0 (- vlf-file-size vlf-batch-size)))
(end vlf-file-size)
+ (reporter (make-progress-reporter
+ (concat "Searching for line -"
+ (number-to-string n) "...")
+ 0 vlf-file-size))
(inhibit-read-only t))
+ (setq n (- n))
(vlf-with-undo-disabled
- (while (and (< (- end) n) (< n (- start end)))
+ (while (and (< (- end start) n) (< n end))
(erase-buffer)
(insert-file-contents-literally buffer-file-name nil
start end)
(goto-char (point-max))
(while (re-search-backward "[\n\C-m]" nil t)
- (setq n (1+ n)))
+ (setq n (1- n)))
(setq end start
- start (max 0 (- end vlf-batch-size))))
- (when (< (- end) n)
+ start (max 0 (- end vlf-batch-size)))
+ (progress-reporter-update reporter
+ (- vlf-file-size end)))
+ (progress-reporter-done reporter)
+ (when (< n end)
(vlf-move-to-chunk-2 start end)
(goto-char (point-max))
- (setq success (vlf-re-search "[\n\C-m]" (- n) t 0))))))
+ (setq success (vlf-re-search "[\n\C-m]" n t 0))))))
(unless success
(vlf-move-to-chunk-2 start-pos end-pos)
(goto-char pos)))))
- [elpa] externals/vlf 371c560 158/310: Bump version and remove warning - save is now reliable., (continued)
- [elpa] externals/vlf 371c560 158/310: Bump version and remove warning - save is now reliable., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf c68c34e 160/310: Add vlf-application customization which refines control over when, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a0cafa7 161/310: Explicitly offer vlf-prefix-map so user can easily define another prefix, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ea46386 168/310: Don't apply VLF by default over image and pdf files., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 2470fc0 181/310: Fix vlf-shift-undo-list to reverse resulting list., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 161a4ec 184/310: Prevent inserting of too small file regions for GNU Emacs later than, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 95e6259 188/310: Add convenience macro to disable VLF application during execution of, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 66db665 189/310: Fix follow functionality and explicitly set variable as buffer local., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 38e8f6c 199/310: Update file size when moving to end of buffer., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 47c154c 194/310: Fix detection of good chunk start., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 1a1ce27 212/310: Add progress reporters for the optimized part of line search.,
Stefan Monnier <=
- [elpa] externals/vlf e747de4 204/310: Unify and optimize deletion., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9510c70 215/310: Retry decoding when the initial attempt seems wrong., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 5c604c4 211/310: Optimize vlf-goto-line not to decode batches as long as possible., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a71ee32 216/310: Skip adjustment in some cases of overlapping chunk., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf b235cf9 224/310: Execute vlf-after-batch-functions hook even on user quit command before, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 6bb60b7 225/310: Fix hexl scroll up called from scroll down behavior., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 924d6b1 219/310: Revert to using insert-file-contents instead of manual decoding., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 859c1e4 223/310: Fix hook names., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 694d1de 235/310: Allow vlf-occur results be saved to file and later reused., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 274c5ab 233/310: Perform search, occur and ediff operations over hexl content instead, Stefan Monnier, 2020/11/28