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

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

[elpa] externals/vlf f4526a1 287/310: Forbid short-cutting in line searc


From: Stefan Monnier
Subject: [elpa] externals/vlf f4526a1 287/310: Forbid short-cutting in line search.
Date: Sat, 28 Nov 2020 00:33:33 -0500 (EST)

branch: externals/vlf
commit f4526a1492a799e671b0efbe044e3720b0aa0b0f
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>

    Forbid short-cutting in line search.
---
 vlf-search.el | 52 ++++++++++++++++++++++++++--------------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/vlf-search.el b/vlf-search.el
index a6a9808..89420c3 100644
--- a/vlf-search.el
+++ b/vlf-search.el
@@ -256,19 +256,19 @@ Search is performed chunk by chunk in `vlf-batch-size' 
memory."
                     (inhibit-read-only t))
                 (setq n (1- n))
                 (vlf-with-undo-disabled
-                 (while (and (< (- end start) n)
-                             (< n (- vlf-file-size start)))
-                   (erase-buffer)
-                   (vlf-tune-insert-file-contents-literally start end)
-                   (goto-char (point-min))
-                   (while (re-search-forward "[\n\C-m]" nil t)
-                     (setq n (1- n)))
-                   (vlf-verify-size)
-                   (vlf-tune-batch '(:raw))
-                   (setq start end
-                         end (min vlf-file-size (+ start
-                                                   vlf-batch-size)))
-                   (progress-reporter-update reporter start))
+                 ;; (while (and (< (- end start) n)
+                 ;;             (< n (- vlf-file-size start)))
+                 ;;   (erase-buffer)
+                 ;;   (vlf-tune-insert-file-contents-literally start end)
+                 ;;   (goto-char (point-min))
+                 ;;   (while (re-search-forward "[\n\C-m]" nil t)
+                 ;;     (setq n (1- n)))
+                 ;;   (vlf-verify-size)
+                 ;;   (vlf-tune-batch '(:raw))
+                 ;;   (setq start end
+                 ;;         end (min vlf-file-size (+ start
+                 ;;                                   vlf-batch-size)))
+                 ;;   (progress-reporter-update reporter start))
                  (when (< n (- vlf-file-size end))
                    (vlf-tune-batch '(:insert :encode))
                    (vlf-move-to-chunk-2 start (+ start vlf-batch-size))
@@ -278,8 +278,7 @@ Search is performed chunk by chunk in `vlf-batch-size' 
memory."
                              (when (vlf-re-search "[\n\C-m]" n nil 0
                                                   reporter time)
                                (forward-char) t))))))
-            (let ((start (max 0 (- vlf-file-size vlf-batch-size)))
-                  (end vlf-file-size)
+            (let ((end vlf-file-size)
                   (reporter (make-progress-reporter
                              (concat "Searching for line -"
                                      (number-to-string n) "...")
@@ -287,17 +286,18 @@ Search is performed chunk by chunk in `vlf-batch-size' 
memory."
                   (inhibit-read-only t))
               (setq n (- n))
               (vlf-with-undo-disabled
-               (while (and (< (- end start) n) (< n end))
-                 (erase-buffer)
-                 (vlf-tune-insert-file-contents-literally start end)
-                 (goto-char (point-max))
-                 (while (re-search-backward "[\n\C-m]" nil t)
-                   (setq n (1- n)))
-                 (vlf-tune-batch '(:raw))
-                 (setq end start
-                       start (max 0 (- end vlf-batch-size)))
-                 (progress-reporter-update reporter
-                                           (- vlf-file-size end)))
+               ;; (let ((start (max 0 (- vlf-file-size vlf-batch-size))))
+               ;;   (while (and (< (- end start) n) (< n end))
+               ;;     (erase-buffer)
+               ;;     (vlf-tune-insert-file-contents-literally start end)
+               ;;     (goto-char (point-max))
+               ;;     (while (re-search-backward "[\n\C-m]" nil t)
+               ;;       (setq n (1- n)))
+               ;;     (vlf-tune-batch '(:raw))
+               ;;     (setq end start
+               ;;           start (max 0 (- end vlf-batch-size)))
+               ;;     (progress-reporter-update reporter
+               ;;                               (- vlf-file-size end))))
                (when (< n end)
                  (vlf-tune-batch '(:insert :encode))
                  (vlf-move-to-chunk-2 (- end vlf-batch-size) end)



reply via email to

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