1
0
mirror of https://github.com/m00natic/vlfi.git synced 2025-01-31 02:00:47 +00:00

Don't launch vlf when file size is less than vlf-batch-size.

This commit is contained in:
Andrey Kotlarski 2014-08-12 03:18:03 +03:00
parent ece554a3bd
commit a1ca1e3428
2 changed files with 8 additions and 4 deletions

View File

@ -28,7 +28,7 @@
;;; Code: ;;; Code:
(defcustom vlf-batch-size 1024 (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) :group 'vlf :type 'integer)
(put 'vlf-batch-size 'permanent-local t) (put 'vlf-batch-size 'permanent-local t)
@ -108,8 +108,7 @@ bytes added to the end."
0))) 0)))
(setq vlf-start-pos place (setq vlf-start-pos place
vlf-end-pos place) vlf-end-pos place)
(if (not minimal) (or minimal (vlf-update-buffer-name))
(vlf-update-buffer-name))
(cons (- start place) (- place end))))) (cons (- start place) (- place end)))))
((or (/= start vlf-start-pos) ((or (/= start vlf-start-pos)
(/= end vlf-end-pos)) (/= end vlf-end-pos))

View File

@ -29,6 +29,10 @@
(defgroup vlf nil "View Large Files in Emacs." (defgroup vlf nil "View Large Files in Emacs."
:prefix "vlf-" :group 'files) :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 (defcustom vlf-application 'ask
"Determines when `vlf' will be offered on opening files. "Determines when `vlf' will be offered on opening files.
Possible values are: nil to never use it; Possible values are: nil to never use it;
@ -98,7 +102,8 @@ OP-TYPE specifies the file operation being performed over FILENAME."
(vlf filename) (vlf filename)
(error "")) (error ""))
((and large-file-warning-threshold ((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) (if (eq vlf-application 'dont-ask)
(progn (vlf filename) (progn (vlf filename)
(error "")) (error ""))