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

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

[elpa] externals/vlf a1ca1e3 232/310: Don't launch vlf when file size is


From: Stefan Monnier
Subject: [elpa] externals/vlf a1ca1e3 232/310: Don't launch vlf when file size is less than vlf-batch-size.
Date: Sat, 28 Nov 2020 00:33:22 -0500 (EST)

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

    Don't launch vlf when file size is less than vlf-batch-size.
---
 vlf-base.el      | 5 ++---
 vlf-integrate.el | 7 ++++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/vlf-base.el b/vlf-base.el
index 98b6831..e9a11bc 100644
--- a/vlf-base.el
+++ b/vlf-base.el
@@ -28,7 +28,7 @@
 ;;; Code:
 
 (defcustom vlf-batch-size 1024
-  "Defines how large each batch of file data is (in bytes)."
+  "Defines how large each batch of file data initially is (in bytes)."
   :group 'vlf :type 'integer)
 (put 'vlf-batch-size 'permanent-local t)
 
@@ -108,8 +108,7 @@ bytes added to the end."
                           0)))
              (setq vlf-start-pos place
                    vlf-end-pos place)
-             (if (not minimal)
-                 (vlf-update-buffer-name))
+             (or minimal (vlf-update-buffer-name))
              (cons (- start place) (- place end)))))
         ((or (/= start vlf-start-pos)
              (/= end vlf-end-pos))
diff --git a/vlf-integrate.el b/vlf-integrate.el
index 435ac45..aa65b76 100644
--- a/vlf-integrate.el
+++ b/vlf-integrate.el
@@ -29,6 +29,10 @@
 (defgroup vlf nil "View Large Files in Emacs."
   :prefix "vlf-" :group 'files)
 
+(defcustom vlf-batch-size 1024
+  "Defines how large each batch of file data initially is (in bytes)."
+  :group 'vlf :type 'integer)
+
 (defcustom vlf-application 'ask
   "Determines when `vlf' will be offered on opening files.
 Possible values are: nil to never use it;
@@ -98,7 +102,8 @@ OP-TYPE specifies the file operation being performed over 
FILENAME."
     (vlf filename)
     (error ""))
    ((and large-file-warning-threshold
-         (< large-file-warning-threshold size))
+         (< large-file-warning-threshold size)
+         (< vlf-batch-size size))
     (if (eq vlf-application 'dont-ask)
         (progn (vlf filename)
                (error ""))



reply via email to

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