mirror of
https://github.com/m00natic/vlfi.git
synced 2025-01-18 12:05:31 +00:00
Add command to set batch size explicitly.
This commit is contained in:
parent
5d30eb4826
commit
c533bce956
@ -92,12 +92,12 @@ Here's example how to add another prefix (*C-x v*):
|
||||
|
||||
** Control batch size
|
||||
|
||||
Use *M-x vlf-set-batch-size* to change batch size and update chunk
|
||||
immediately.
|
||||
|
||||
*C-c C-v +* and *C-c C-v -* control current batch size by factors
|
||||
of 2.
|
||||
|
||||
You can also set by hand local variable *vlf-batch-size* and then
|
||||
refresh with *C-c C-v g*.
|
||||
|
||||
** Move around
|
||||
|
||||
Scrolling automatically triggers moving to previous or next chunk at
|
||||
|
13
vlf.el
13
vlf.el
@ -53,6 +53,8 @@
|
||||
"Toggle continuous chunk recenter around current point.")
|
||||
(autoload 'vlf-stop-follow "vlf-follow"
|
||||
"Stop continuous recenter.")
|
||||
(autoload 'vlf-ediff-buffers "vlf-ediff"
|
||||
"Run batch by batch ediff over VLF buffers." t)
|
||||
|
||||
(defvar vlf-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
@ -71,6 +73,7 @@
|
||||
(define-key map "]" 'vlf-end-of-file)
|
||||
(define-key map "j" 'vlf-jump-to-chunk)
|
||||
(define-key map "l" 'vlf-goto-line)
|
||||
(define-key map "e" 'vlf-ediff-buffers)
|
||||
(define-key map "f" 'vlf-toggle-follow)
|
||||
(define-key map "g" 'vlf-revert)
|
||||
map)
|
||||
@ -186,9 +189,13 @@ When prefix argument is negative
|
||||
Normally, the value is doubled;
|
||||
with the prefix argument DECREASE it is halved."
|
||||
(interactive "P")
|
||||
(setq vlf-batch-size (if decrease
|
||||
(/ vlf-batch-size 2)
|
||||
(* vlf-batch-size 2)))
|
||||
(vlf-set-batch-size (if decrease (/ vlf-batch-size 2)
|
||||
(* vlf-batch-size 2))))
|
||||
|
||||
(defun vlf-set-batch-size (size)
|
||||
"Set batch to SIZE bytes and update chunk."
|
||||
(interactive (list (read-number "Size in bytes: " vlf-batch-size)))
|
||||
(setq vlf-batch-size size)
|
||||
(vlf-move-to-batch vlf-start-pos))
|
||||
|
||||
(defun vlf-beginning-of-file ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user