From 51d95ec0a397269b72eabd2c4d9d3d14a2b99ddc Mon Sep 17 00:00:00 2001 From: Andrey Kotlarski Date: Sat, 7 Dec 2013 20:18:07 +0200 Subject: [PATCH] Add command to display batch starting from point. --- README.org | 2 ++ vlf.el | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/README.org b/README.org index 42ada96..d371c6f 100644 --- a/README.org +++ b/README.org @@ -57,6 +57,8 @@ refresh with *C-c C-v g*. prefix argument they move prefix number of batches. With negative - append prefix number of batches. +*C-c C-v n* displays batch starting from current point. + *C-c C-v [* and *C-c C-v ]* take you to the beginning and end of file respectively. diff --git a/vlf.el b/vlf.el index 4f01a7b..51a6c06 100644 --- a/vlf.el +++ b/vlf.el @@ -65,6 +65,7 @@ (map (make-sparse-keymap))) (define-key map [next] 'vlf-next-batch) (define-key map [prior] 'vlf-prev-batch) + (define-key map "n" 'vlf-next-batch-from-point) (define-key map "+" 'vlf-change-batch-size) (define-key map "-" (lambda () "Decrease vlf batch size by factor of 2." @@ -325,6 +326,12 @@ When given MINIMAL flag, skip non important operations." (setq start (max 0 (- end vlf-batch-size)))) (vlf-move-to-chunk start end minimal))) +(defun vlf-next-batch-from-point () + "Display batch of file data starting from current point." + (interactive) + (vlf-move-to-batch (+ vlf-start-pos (position-bytes (point)) -1)) + (goto-char (point-min))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; primitive chunk operations