[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf bbda9ab 105/310: Merge branch 'master' into chunk-o
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf bbda9ab 105/310: Merge branch 'master' into chunk-opt2 |
Date: |
Sat, 28 Nov 2020 00:32:56 -0500 (EST) |
branch: externals/vlf
commit bbda9abc7d3e9cf7267d10ed6f55a5f1898c48f5
Merge: ca13bea 6773248
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Merge branch 'master' into chunk-opt2
Conflicts:
vlfi.el
---
README.org | 29 +++++++++++++++++------------
vlfi.el | 23 +++++++++++------------
2 files changed, 28 insertions(+), 24 deletions(-)
diff --git a/README.org b/README.org
index 034ca4e..a59d7a7 100644
--- a/README.org
+++ b/README.org
@@ -33,10 +33,11 @@ Emacs' Unicode support is leveraged so you'll not see bare
bytes but
characters decoded as if file is normally opened. This holds for
editing, search and indexing.
-** Bignums
+** 32-bit GNU/Emacs
-Regular Emacs integers are used, so if you have really huge file and
-Emacs doesn't have bignum support, VLFI will probably not quite work.
+Regular Emacs integers are used, so if you use 32-bit Emacs without
+bignum support and have really huge file (with size beyond the maximum
+integer value), VLFI will probably not quite work.
** Memory control
@@ -49,8 +50,9 @@ example you can directly press digits to enter prefix
arguments.
** Changing major mode
-You can temporarily change major mode to whatever you like. Saving
-will insert contents as intended. You can return to *vlfi-mode* too.
+You can (temporarily) change major mode to whatever you like (for
+example hexl-mode). Saving will insert contents as intended. You can
+return to *vlfi-mode* too.
* Detail usage
@@ -82,17 +84,20 @@ you'd better set somewhat bigger batch size beforehand.
*l* jumps to given line in file. This is done by searching from the
beginning, so again the bigger current batch size, the quicker.
+** Occur over whole file
+
+*o* builds index for given regular expression just like occur-mode.
+It does this chunk by chunk over the whole file. Note that even if
+you prematurely stop it with *C-g*, it will still show index of what's
+found so far.
+
** Edit
*e* enters VLFI in edit mode. If editing doesn't change size of
the chunk, only this chunk is saved. Otherwise the remaining part of
the file is adjusted chunk by chunk, so again you'd better have bigger
current batch size. If chunk has been expanded the memory used is
-(batch size + difference to the original chunk size) x 2.
-** Occur over whole file
-
-*o* builds index for given regular expression just like occur-mode.
-It does this chunk by chunk over the whole file. Note that even if
-you prematurely stop it with *C-g*, it will still show index of what's
-found so far.
+#+BEGIN_EXAMPLE
+(batch size + difference to the original chunk size) x 2
+#+END_EXAMPLE
diff --git a/vlfi.el b/vlfi.el
index 0d82fcc..0b1137e 100644
--- a/vlfi.el
+++ b/vlfi.el
@@ -26,9 +26,9 @@
;;; Commentary:
;; This package provides the M-x vlfi command, which visits part of a
-;; large file in a read-only buffer without visiting the entire file.
+;; large file without loading the entire file.
;; The buffer uses VLFI mode, which defines several commands for
-;; moving around, searching and editing selected chunk of file.
+;; moving around, searching and editing selected part of file.
;; This package is upgraded version of the vlf.el package.
@@ -47,8 +47,7 @@
;;; Keep track of file position.
(defvar vlfi-start-pos 0
"Absolute position of the visible chunk start.")
-(defvar vlfi-end-pos 0
- "Absolute position of the visible chunk end.")
+(defvar vlfi-end-pos 0 "Absolute position of the visible chunk end.")
(defvar vlfi-file-size 0 "Total size of presented file.")
(defvar vlfi-mode-map
@@ -426,8 +425,9 @@ Return cons \(success-status .
number-of-bytes-moved-back\)."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; search
-(defun vlfi-re-search (regexp count backward)
- "Search for REGEXP COUNT number of times forward or BACKWARD."
+(defun vlfi-re-search (regexp count backward batch-step)
+ "Search for REGEXP COUNT number of times forward or BACKWARD.
+BATCH-STEP is amount of overlap between successive chunks."
(let* ((match-chunk-start vlfi-start-pos)
(match-chunk-end vlfi-end-pos)
(match-start-pos (+ vlfi-start-pos (position-bytes (point))))
@@ -438,8 +438,7 @@ Return cons \(success-status .
number-of-bytes-moved-back\)."
(if backward
(- vlfi-file-size vlfi-end-pos)
vlfi-start-pos)
- vlfi-file-size))
- (batch-step (/ vlfi-batch-size 8))) ; amount of chunk overlap
+ vlfi-file-size)))
(unwind-protect
(catch 'end-of-file
(if backward
@@ -550,7 +549,7 @@ Search is performed chunk by chunk in `vlfi-batch-size'
memory."
(if regexp-history
(car regexp-history)))
(or current-prefix-arg 1)))
- (vlfi-re-search regexp count nil))
+ (vlfi-re-search regexp count nil (/ vlfi-batch-size 8)))
(defun vlfi-re-search-backward (regexp count)
"Search backward for REGEXP prefix COUNT number of times.
@@ -559,7 +558,7 @@ Search is performed chunk by chunk in `vlfi-batch-size'
memory."
(if regexp-history
(car regexp-history)))
(or current-prefix-arg 1)))
- (vlfi-re-search regexp count t))
+ (vlfi-re-search regexp count t (/ vlfi-batch-size 8)))
(defun vlfi-goto-line (n)
"Go to line N."
@@ -571,8 +570,8 @@ Search is performed chunk by chunk in `vlfi-batch-size'
memory."
(unwind-protect
(progn (vlfi-beginning-of-file)
(goto-char (point-min))
- (setq success (vlfi-re-search-forward "[\n\C-m]"
- (1- n))))
+ (setq success (vlfi-re-search "[\n\C-m]" (1- n)
+ nil 0)))
(unless success
(vlfi-move-to-chunk start-pos end-pos)
(goto-char pos)))))
- [elpa] externals/vlf 1dcd122 086/310: Use overlays for number indicators., (continued)
- [elpa] externals/vlf 1dcd122 086/310: Use overlays for number indicators., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f14ef6c 087/310: Usability improvements to vlfi-occur., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 54927af 088/310: Update README and bump version., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf b8cc344 091/310: Add more detailed usage details., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf eaf85e5 093/310: Add key-binding to vlfi-mode-map in vlfi-edit-mode-map., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf e4d886a 092/310: Add check if VLFI buffer has been modified before occur jumping to new, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a63ea7a 095/310: Grammar fixes., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 57eb4c2 099/310: Initial attempt at optimizing chunk access., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d2bd47c 100/310: More attempts to optimize decoding., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 7bfe665 102/310: More secure chunk decode adjustment and minor fixes., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf bbda9ab 105/310: Merge branch 'master' into chunk-opt2,
Stefan Monnier <=
- [elpa] externals/vlf 1ac1eec 106/310: Turn vlfi-get-file-size to function., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf de1948e 108/310: Merge branch 'master' into chunk-opt2, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf c827c3e 110/310: Prevent standard save procedure invocation in case user postpones, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf b943008 113/310: Bump version and update README., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf c1aedbc 116/310: Update README: VLFI is now development version of VLF., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 616d676 114/310: Alters vlfi to respect the default-directory variable when opening, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 3d652fe 103/310: Minor documentation fixes., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 4589c25 112/310: Return to current position after occur ending with quit., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ce9441f 120/310: Update info as VLFI is merging back to VLF. Bump version., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 7cb0474 122/310: Add forgotten vlfi-encode-size local variable creation., Stefan Monnier, 2020/11/28