X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/cae1efcf4cb7db0f763f353e3f895cb312cb1a3d..6517ec8921438deae6547ab5eb38e004935d5618:/packages/vlf/vlf-integrate.el diff --git a/packages/vlf/vlf-integrate.el b/packages/vlf/vlf-integrate.el index c07239879..7bc8f9475 100644 --- a/packages/vlf/vlf-integrate.el +++ b/packages/vlf/vlf-integrate.el @@ -26,10 +26,12 @@ ;;; Code: -(defgroup vlf nil - "View Large Files in Emacs." - :prefix "vlf-" - :group 'files) +(defgroup vlf nil "View Large Files in Emacs." + :prefix "vlf-" :group 'files) + +(defcustom vlf-batch-size 1000000 + "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. @@ -37,18 +39,16 @@ Possible values are: nil to never use it; `ask' offer `vlf' when file size is beyond `large-file-warning-threshold'; `dont-ask' automatically use `vlf' for large files; `always' use `vlf' for all files." - :group 'vlf - :type '(radio (const :format "%v " nil) - (const :format "%v " ask) - (const :format "%v " dont-ask) - (const :format "%v" always))) + :group 'vlf :type '(radio (const :format "%v " nil) + (const :format "%v " ask) + (const :format "%v " dont-ask) + (const :format "%v" always))) (defcustom vlf-forbidden-modes-list '(archive-mode tar-mode jka-compr git-commit-mode image-mode doc-view-mode doc-view-mode-maybe ebrowse-tree-mode) "Major modes which VLF will not be automatically applied to." - :group 'vlf - :type '(list symbol)) + :group 'vlf :type '(list symbol)) (unless (fboundp 'file-size-human-readable) (defun file-size-human-readable (file-size) @@ -102,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 ""))