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

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

[elpa] externals/vlf 35ede94 255/310: Restore batch size after save with


From: Stefan Monnier
Subject: [elpa] externals/vlf 35ede94 255/310: Restore batch size after save with adjustment.
Date: Sat, 28 Nov 2020 00:33:26 -0500 (EST)

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

    Restore batch size after save with adjustment.
---
 vlf-write.el | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/vlf-write.el b/vlf-write.el
index f15799a..a29e1a9 100644
--- a/vlf-write.el
+++ b/vlf-write.el
@@ -64,19 +64,21 @@ If changing size of chunk, shift remaining file content."
                   (pos (point))
                   (font-lock font-lock-mode))
               (font-lock-mode 0)
-              (let ((time (float-time)))
+              (let ((batch-size vlf-batch-size)
+                    (time (float-time)))
                 (if (< 0 size-change)
                     (vlf-file-shift-back size-change region-length)
                   (vlf-file-shift-forward (- size-change) region-length))
-                (message "Save took %f seconds" (- (float-time) time)))
-              (if font-lock (font-lock-mode 1))
-              (vlf-move-to-chunk-2 vlf-start-pos
-                                   (if (< (- vlf-end-pos vlf-start-pos)
-                                          vlf-batch-size)
-                                       (+ vlf-start-pos vlf-batch-size)
-                                     vlf-end-pos))
-              (vlf-update-buffer-name)
-              (goto-char pos)))))
+                (if font-lock (font-lock-mode 1))
+                (setq vlf-batch-size batch-size)
+                (vlf-move-to-chunk-2 vlf-start-pos
+                                     (if (< (- vlf-end-pos vlf-start-pos)
+                                            vlf-batch-size)
+                                         (+ vlf-start-pos vlf-batch-size)
+                                       vlf-end-pos))
+                (vlf-update-buffer-name)
+                (goto-char pos)
+                (message "Save took %f seconds" (- (float-time) time)))))))
       (if hexl (vlf-tune-hexlify)))
     (run-hook-with-args 'vlf-after-batch-functions 'write))
   t)



reply via email to

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