branch: externals/vlf
commit b62bc046128df83c816a9b199ab5b4a7fcf93837
Author: Dan Harms <[email protected]>
Commit: Andrey Kotlarski <[email protected]>
Issue 31 Make vlf-batch-size configurable in the remote case
---
vlf.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/vlf.el b/vlf.el
index e695c2c..5d6fcb0 100644
--- a/vlf.el
+++ b/vlf.el
@@ -53,6 +53,10 @@ One argument is supplied that specifies current action.
Possible
values are: `write', `ediff', `occur', `search', `goto-line'."
:group 'vlf :type 'hook)
+(defcustom vlf-batch-size-remote 1024
+ "Defines size (in bytes) of a batch of file data when accessed remotely."
+ :group 'vlf :type 'integer)
+
(defvar hexl-bits)
(autoload 'vlf-write "vlf-write" "Write current chunk to file." t)
@@ -172,8 +176,10 @@ Return newly created buffer."
(set-buffer vlf-buffer)
(set-visited-file-name file)
(set-buffer-modified-p nil)
- (if (or minimal (file-remote-p file))
- (set (make-local-variable 'vlf-batch-size) 1024))
+ (cond (minimal
+ (set (make-local-variable 'vlf-batch-size) 1024))
+ ((file-remote-p file)
+ (set (make-local-variable 'vlf-batch-size) vlf-batch-size-remote)))
(vlf-mode 1)
(when minimal ;restore batch size to default value
(kill-local-variable 'vlf-batch-size)