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

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

[elpa] externals/vlf 8ab1c6a 136/310: Disable undo and mark buffer as no


From: Stefan Monnier
Subject: [elpa] externals/vlf 8ab1c6a 136/310: Disable undo and mark buffer as not modified when invoking search or
Date: Sat, 28 Nov 2020 00:33:02 -0500 (EST)

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

    Disable undo and mark buffer as not modified when invoking search or
    indexing.
---
 vlf.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/vlf.el b/vlf.el
index 3fc0cf4..5a2ce16 100644
--- a/vlf.el
+++ b/vlf.el
@@ -451,6 +451,8 @@ BATCH-STEP is amount of overlap between successive chunks."
                         (- vlf-file-size vlf-end-pos)
                       vlf-start-pos)
                     vlf-file-size)))
+    (set-buffer-modified-p nil)
+    (buffer-disable-undo)
     (unwind-protect
         (catch 'end-of-file
           (if backward
@@ -511,6 +513,7 @@ BATCH-STEP is amount of overlap between successive chunks."
                        (progress-reporter-update reporter
                                                  vlf-end-pos)))))
           (progress-reporter-done reporter))
+      (set-buffer-modified-p nil)
       (if backward
           (vlf-goto-match match-chunk-start match-chunk-end
                            match-end-pos match-start-pos
@@ -550,8 +553,8 @@ successful.  Return nil if nothing found."
           (goto-char match-end)
           (message "Moved to the %d match which is last"
                    (- count to-find)))
-        (sit-for 0.1)
-        (delete-overlay overlay)
+        (unwind-protect (sit-for 5)
+          (delete-overlay overlay))
         t))))
 
 (defun vlf-re-search-forward (regexp count)
@@ -677,7 +680,10 @@ Prematurely ending indexing will still show what's found 
so far."
         (pos (point)))
     (vlf-beginning-of-file)
     (goto-char (point-min))
+    (set-buffer-modified-p nil)
+    (buffer-disable-undo)
     (unwind-protect (vlf-build-occur regexp)
+      (set-buffer-modified-p nil)
       (vlf-move-to-chunk start-pos end-pos)
       (goto-char pos))))
 



reply via email to

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