1
0
mirror of https://github.com/m00natic/vlfi.git synced 2025-11-13 13:25:35 +00:00

149 Commits
0.3 ... 1.1

Author SHA1 Message Date
Andrey Kotlarski
371c560f4b Bump version and remove warning - save is now reliable. 2013-12-11 01:11:13 +02:00
Andrey Kotlarski
a3901b8f1a Fix deletion when moving to partially overlapping chunk and enable more
intelligent behaviour in cases of overlapping and modifications.
2013-12-09 01:55:41 +02:00
Andrey Kotlarski
f4ee23c07f Fix chunk end adjustment and save for current and older Emacsen. 2013-12-08 21:11:08 +02:00
Andrey Kotlarski
959bbc7661 Disable undo in cases of partial chunk move. 2013-12-08 17:22:23 +02:00
Andrey Kotlarski
0080991fa9 Fix chunk end adjustment and save for trunk Emacs. 2013-12-08 17:21:34 +02:00
Andrey Kotlarski
46e39a0fd8 Version 1.0. 2013-12-07 20:20:41 +02:00
Andrey Kotlarski
51d95ec0a3 Add command to display batch starting from point. 2013-12-07 20:18:07 +02:00
Andrey Kotlarski
d6c722376c Delete obsolete vlfi.el. 2013-12-07 19:50:19 +02:00
Andrey Kotlarski
a42247cac4 Automatically scroll to adjacent batch when start or end of chunk is
visible.
2013-12-04 15:11:04 +02:00
Andrey Kotlarski
3e8098af61 Rename vlf-discard-edit -> vlf-refresh. 2013-12-04 14:44:11 +02:00
Andrey Kotlarski
28646fbfee Reduce scope of vlf-with-undo-disabled usages. 2013-12-04 14:40:07 +02:00
Andrey Kotlarski
177c680288 Revert to showing batch size in buffer name instead of the mode-line. 2013-12-04 14:00:24 +02:00
Andrey Kotlarski
2ac3e7d577 Fix prematurely ending search/occur not to ask for modified buffer
confirmation.
2013-12-04 13:59:08 +02:00
Andrey Kotlarski
931ca52688 Stylistic refinements. 2013-12-04 00:20:02 +02:00
Andrey Kotlarski
42e581da61 Add command to unconditionally open fresh VLF buffer to visit occur
match.
2013-12-04 00:15:31 +02:00
Andrey Kotlarski
a65f3a431d Check for unsaved changes before search query and don't enable undo if
it was previously disabled.
2013-12-04 00:03:29 +02:00
Andrey Kotlarski
f34986a9b8 Update README. 2013-12-03 02:54:33 +02:00
Andrey Kotlarski
452b7eb42d Ensure there are no modifications when executing searches. 2013-12-03 02:37:13 +02:00
Andrey Kotlarski
2dba838015 In case original VLF buffer has been killed, try to find existing VLF
buffer for the same file when visiting occur results.
2013-12-03 02:04:27 +02:00
Andrey Kotlarski
cb47e19128 Use temporary buffer for occur in case of modifications. 2013-12-03 01:50:03 +02:00
Andrey Kotlarski
efae918a83 Turn vlf into minor mode. 2013-12-02 02:08:24 +02:00
Andrey Kotlarski
7a141091c8 Fix search for GNU Emacs 23 (no assert). 2013-08-26 12:29:39 +03:00
Andrey Kotlarski
8ab1c6a4f2 Disable undo and mark buffer as not modified when invoking search or
indexing.
2013-08-26 12:03:18 +03:00
Andrey Kotlarski
ae2237d7ea Minor adjustments:
- fix batch position formatting
- unconditionally update chunk on revert
- do nothing if same chunk is requested in `vlf-move-to-chunk'
2013-08-26 00:39:51 +03:00
Andrey Kotlarski
9b22b74f21 Add gitignore. 2013-08-25 23:01:55 +03:00
Andrey Kotlarski
025399a644 Merge branch 'master' into keep-edit
Conflicts:
	README.org
	vlfi.el
2013-08-25 19:17:04 +03:00
Andrey Kotlarski
bfcbfd33cb Make error message more descriptive. 2013-08-25 18:23:06 +03:00
Andrey Kotlarski
bc68eed5a2 Add dummy vlfi.el that urges move to the vlf package. 2013-08-25 18:14:53 +03:00
Andrey Kotlarski
17c66122d9 Rename anything vlfi -> vlf. 2013-08-25 17:57:43 +03:00
Andrey Kotlarski
4c631bcbe5 Rename vlfi.el to vlf.el. 2013-08-25 17:51:34 +03:00
Andrey Kotlarski
e5457690fb Fix adjusting of end chunk bytes. 2013-08-25 17:48:28 +03:00
Andrey Kotlarski
d1b34dcefb Add autoload cookie for `file-size-human-readable' not to break GNU
Emacs 23 opening of large files.
2013-08-13 12:39:55 +03:00
Andrey Kotlarski
737c1e9979 Remove encode size bookkeeping. 2013-08-09 02:00:34 +03:00
Andrey Kotlarski
2d71996d9e Add end character shift when adjusting chunk. Apply partial chunk
update when buffer is not modified too.
2013-08-09 01:59:32 +03:00
Andrey Kotlarski
0ecb40a5ee Keep as much editing as possible when moving to intersecting chunk. 2013-08-08 12:43:00 +03:00
Andrey Kotlarski
02a37c4192 Merge branch 'master' into chunk-opt2 2013-08-07 01:19:26 +03:00
Andrey Kotlarski
7cb047407d Add forgotten vlfi-encode-size local variable creation. 2013-08-06 16:41:16 +03:00
Andrey Kotlarski
34dfbd202d Use set-visited-file-name and abstract getting current file size and
updating visited time.
2013-08-06 16:23:04 +03:00
Andrey Kotlarski
ce9441fc83 Update info as VLFI is merging back to VLF. Bump version. 2013-08-06 02:14:39 +03:00
Andrey Kotlarski
563d9ca423 Fix vlfi-revert to revert on user confirmation. 2013-08-06 02:13:01 +03:00
Andrey Kotlarski
298d8f59d9 Keep track of current batch encoded size and allow fluctuation when
searching for proper decoding.
2013-08-06 02:11:21 +03:00
Andrey Kotlarski
8ed919209a Review fixes:
- move put statements to top level
- add write-file-functions hook locally
- vlfi-if-file-too-large becomes around advice
- minor style changes
2013-08-06 02:07:36 +03:00
Andrey Kotlarski
c1aedbc307 Update README: VLFI is now development version of VLF. 2013-08-06 02:02:02 +03:00
Andrey Kotlarski
a0b8d5f67a Merge pull request #3 from danlamanna/master
Alters vlfi to respect the default-directory variable when opening
files.
2013-07-25 01:17:35 -07:00
Dan LaManna
616d676330 Alters vlfi to respect the default-directory variable when opening
files.
2013-07-24 21:49:14 -04:00
Andrey Kotlarski
b943008eca Bump version and update README. 2013-06-09 02:34:52 +03:00
Andrey Kotlarski
4589c25d96 Return to current position after occur ending with quit. 2013-05-07 15:43:52 +03:00
Andrey Kotlarski
3c2fb6b93e Merge branch 'master' into chunk-opt2 2013-05-05 15:57:16 +03:00
Andrey Kotlarski
c827c3e186 Prevent standard save procedure invocation in case user postpones
saving.
2013-05-04 23:53:17 +03:00
Andrey Kotlarski
36d2ed4d09 Update README. 2013-05-02 14:25:39 +03:00
Andrey Kotlarski
de1948ed36 Merge branch 'master' into chunk-opt2 2013-05-02 14:19:50 +03:00
Andrey Kotlarski
ae775f88f9 Extend vlfi-goto-line to count lines from the end with negative
argument.
2013-05-02 14:18:41 +03:00
Andrey Kotlarski
1ac1eece40 Turn vlfi-get-file-size to function. 2013-05-02 12:04:12 +03:00
Andrey Kotlarski
bbda9abc7d Merge branch 'master' into chunk-opt2
Conflicts:
	vlfi.el
2013-05-01 02:25:39 +03:00
Andrey Kotlarski
67732485d8 Optimize a bit goto line. 2013-05-01 02:18:37 +03:00
Andrey Kotlarski
3d652fe71d Minor documentation fixes. 2013-05-01 02:02:28 +03:00
Andrey Kotlarski
7bfe665524 More secure chunk decode adjustment and minor fixes. 2013-05-01 01:51:36 +03:00
Andrey Kotlarski
ca13beac24 Try utf-8 and if not successful, auto detect when adjusting chunk for
proper decoding.
2013-04-28 01:12:07 +03:00
Andrey Kotlarski
d2bd47c2b4 More attempts to optimize decoding. 2013-04-24 01:32:50 +03:00
Andrey Kotlarski
57eb4c270a Initial attempt at optimizing chunk access. 2013-04-24 01:32:50 +03:00
Colin Marquardt
28255a2aa2 Correctly print MB (for older emacsen). 2013-04-23 19:15:43 +03:00
Andrey Kotlarski
fbe081417c Fix occur indexing not to skip last chunk. 2013-04-23 00:53:54 +03:00
Andrey Kotlarski
fd9c258fc8 Use permanent buffer local write hook and update README. 2013-04-17 14:46:50 +03:00
Andrey Kotlarski
a63ea7a5d0 Grammar fixes. 2013-04-17 13:19:37 +03:00
Andrey Kotlarski
fbc3a37ce5 Add tip for ability to change major mode and more section hierarchy. 2013-04-17 13:11:40 +03:00
Andrey Kotlarski
eaf85e5cff Add key-binding to vlfi-mode-map in vlfi-edit-mode-map. 2013-04-17 13:00:37 +03:00
Andrey Kotlarski
e4d886a3e3 Add check if VLFI buffer has been modified before occur jumping to new
chunk.
2013-04-17 12:49:29 +03:00
Andrey Kotlarski
b8cc34422e Add more detailed usage details. 2013-04-17 12:33:04 +03:00
Andrey Kotlarski
a5fec57e32 Mostly documentation and commentary added. 2013-04-17 11:55:02 +03:00
Andrey Kotlarski
70719b0917 Add vlfi-occur-show command for showing match but still staying in
occur buffer.
2013-04-17 11:53:49 +03:00
Andrey Kotlarski
54927afb8f Update README and bump version. 2013-04-16 15:56:10 +03:00
Andrey Kotlarski
f14ef6ce9e Usability improvements to vlfi-occur. 2013-04-16 15:51:30 +03:00
Andrey Kotlarski
1dcd12288b Use overlays for number indicators. 2013-04-16 15:38:36 +03:00
Andrey Kotlarski
641ff4b961 First feature complete version of vlfi-occur. 2013-04-16 14:44:34 +03:00
Andrey Kotlarski
681d3d94fc Add vlfi-occur-mode. 2013-04-16 12:25:06 +03:00
Andrey Kotlarski
ba439de0f6 Initial generation of vlfi-occur results. 2013-04-16 02:16:03 +03:00
Andrey Kotlarski
b34bd2e5fb Don't use temporary buffer when adjusting expanded file content. 2013-04-15 23:38:14 +03:00
Andrey Kotlarski
1589cf9736 Make custom revert function local only for vlfi buffers. 2013-04-15 17:42:11 +03:00
Andrey Kotlarski
83eb8a586b Fixes for GNU Emacs 23. 2013-04-15 17:27:23 +03:00
Andrey Kotlarski
e3be8d5d98 Don't adjust chunk with more that 3 bytes and inhibit spurious update
messages when saving content with changes size.
2013-04-15 15:04:22 +03:00
Andrey Kotlarski
5aef3e1c27 Update file size changes more lazily. 2013-04-15 01:26:58 +03:00
Andrey Kotlarski
ca8ba42ec4 Fix position handling to correctly deal with multibyte characters. 2013-04-15 00:57:10 +03:00
Andrey Kotlarski
a31be70613 Update README and bump version. 2013-04-14 20:01:10 +03:00
Andrey Kotlarski
538a9e6049 Apply chunk decoding adjustment implicitly. 2013-04-14 19:48:20 +03:00
Andrey Kotlarski
469900878d Make chunk adjusting automatic. 2013-04-14 19:28:41 +03:00
Andrey Kotlarski
473536e050 Add adjust command for cases where chunk starts with part of multibyte symbol. 2013-04-14 18:58:30 +03:00
Andrey Kotlarski
74febeb183 Remove ability to launch VLFI from file end. It's superseded by
vlfi-end-of-file and may break decoding of file.
2013-04-14 18:27:31 +03:00
Andrey Kotlarski
fc689d5c88 Make coding system conversion on write more idiomatic. 2013-04-14 18:19:49 +03:00
Andrey Kotlarski
3fb898e83a Add automatic batching when scrolling. 2013-04-14 02:50:31 +03:00
Andrey Kotlarski
f1ade8106c Add go to line command. 2013-04-14 02:21:49 +03:00
Andrey Kotlarski
e67895afc4 Optionally strip superfluous operations when inserting batches. 2013-04-14 01:09:13 +03:00
Andrey Kotlarski
4cbefdeeca Optimize chunk save buffers for multiple insert/erase operations. 2013-04-14 00:54:16 +03:00
Andrey Kotlarski
9fad430601 Fix positioning after save. 2013-04-14 00:53:24 +03:00
Andrey Kotlarski
6ea7a2aa1e Add macro for file size determination. 2013-04-14 00:52:07 +03:00
Andrey Kotlarski
705f9ce0eb Add issue section to the README. 2013-04-13 23:45:30 +03:00
Andrey Kotlarski
b52ca6c044 Don't change encoding for edited chunk, leave it to the user in case
of problem characters.
2013-04-13 23:45:06 +03:00
Andrey Kotlarski
8637ce5ceb Update README and version. 2013-04-13 23:10:47 +03:00
Andrey Kotlarski
2f201c56d5 Add jump to chunk command. 2013-04-13 22:57:09 +03:00
Andrey Kotlarski
d5f2a36086 Rearrange code in sections. 2013-04-13 22:49:08 +03:00
Andrey Kotlarski
cedd0b4e82 Fix spaces and indent. 2013-04-13 22:36:33 +03:00
Andrey Kotlarski
c14c7f00ce Add shift forward of file contents when edited chunk grows in size. 2013-04-13 22:34:54 +03:00
Andrey Kotlarski
f23262e826 Add shift back of file contents when edited chunk shrinks in size. 2013-04-13 20:47:29 +03:00
Andrey Kotlarski
8f6299c6c2 Simplify detection of buffer size change. 2013-04-13 01:29:12 +03:00
Andrey Kotlarski
8787186619 Show paging according to batch size instead of percentage. 2013-04-12 01:01:42 +03:00
Andrey Kotlarski
24675d8741 Manage modification times when attempting to save. 2013-04-12 00:21:14 +03:00
Andrey Kotlarski
e115e7e56a Add custom revert function. 2013-04-11 23:00:34 +03:00
Andrey Kotlarski
7985f0f453 Fix `vlfi-if-file-too-large' to be more tolerable on GNU Emacs 23. 2013-04-11 18:36:39 +03:00
Andrey Kotlarski
a3c405fd37 Make detection of buffer size change on save more correct when dealing
with Unicode.
2013-04-11 18:08:34 +03:00
Andrey Kotlarski
56134a8281 Make vlfi usable under GNU Emacs 23. 2013-04-11 17:45:35 +03:00
Andrey Kotlarski
2525ebf069 Improvements to file saving. 2013-04-11 17:44:32 +03:00
Andrey Kotlarski
c4f87f9ec7 Move save interception to vlfi-mode. 2013-04-11 16:53:38 +03:00
Andrey Kotlarski
467154ad06 Add documentation. 2013-04-10 02:10:00 +03:00
Andrey Kotlarski
06108220e2 Make saving with change of size correct. 2013-04-10 02:08:54 +03:00
Andrey Kotlarski
5405a30de4 Intercept buffer saving with vlfi-write. 2013-04-08 23:24:48 +03:00
Andrey Kotlarski
f3132c0970 Keep current position when moving around chunks. 2013-04-08 12:49:17 +03:00
Andrey Kotlarski
db3d2af04a Update version, README and commentary section. 2013-04-08 01:08:15 +03:00
Andrey Kotlarski
995a7a0988 Change some VLFI key-bindings not to override special-mode ones. 2013-04-08 00:57:53 +03:00
Andrey Kotlarski
1948f3ea4e Make VLFI edit mode actually working. 2013-04-08 00:56:42 +03:00
Andrey Kotlarski
0ff2f3eb9b Merge branch 'master' into edit 2013-04-07 18:54:40 +03:00
Andrey Kotlarski
03f323337b Don't reinsert content and move on successful search. 2013-04-07 18:53:50 +03:00
Andrey Kotlarski
9abee0425a Merge branch 'master' into edit 2013-04-05 00:43:15 +03:00
Andrey Kotlarski
80ca6b638b Fix vlfi invocation when prompted for large files. 2013-04-04 11:49:19 +03:00
Andrey Kotlarski
8a33dbfb89 Add something like edit minor mode. 2013-04-02 02:55:53 +03:00
Andrey Kotlarski
e387ed5f09 Add forgotten local variable statement and documentation. 2013-04-02 01:46:45 +03:00
Andrey Kotlarski
c36db11b86 Return correct search success status. 2013-04-01 14:38:50 +03:00
Andrey Kotlarski
ab20671a93 Abstract batch overlapping during search and optimize a bit. 2013-04-01 14:32:10 +03:00
Andrey Kotlarski
ac382e90dc Add temporary highlight of match. 2013-04-01 12:57:58 +03:00
Andrey Kotlarski
670561e811 Optimize search a bit. 2013-04-01 12:06:48 +03:00
Andrey Kotlarski
88cf03caba Interactive change of batch size immediately updates content. 2013-04-01 11:47:49 +03:00
Andrey Kotlarski
8e65e13dd9 Refactor and simplify search procedures. Always use batch sized
chunks.
2013-04-01 03:09:32 +03:00
Andrey Kotlarski
090cebc2ab Add procedure to insert strictly batch sized chunk (if possible). 2013-04-01 03:08:14 +03:00
Andrey Kotlarski
748fd1406e More key-binding simplification. 2013-04-01 03:07:20 +03:00
Andrey Kotlarski
42693f6938 Update README. 2013-03-31 20:48:08 +03:00
Andrey Kotlarski
b40bb60aa3 Tweaks and fixes to searching. 2013-03-31 20:47:50 +03:00
Andrey Kotlarski
2a7625afe6 Improve correctness of search forward. 2013-03-31 02:36:54 +02:00
Andrey Kotlarski
91fecb78c9 Simplify key-bindings. 2013-03-31 02:35:41 +02:00
Andrey Kotlarski
36411c3632 Enhance search to cover in between chunk boundaries. 2013-03-30 02:51:12 +02:00
Andrey Kotlarski
9e27aeb057 Keep stable cursor position when moving through chunks. 2013-03-30 02:45:51 +02:00
Andrey Kotlarski
fb9aa670cc Remove clutter form file name indicators. 2013-03-30 02:17:34 +02:00
Andrey Kotlarski
30e495901b Add direct jumps to first and last chunks. 2013-03-30 02:16:47 +02:00
Andrey Kotlarski
375c96f89b Add backward whole file search. 2013-03-29 18:12:20 +02:00
Andrey Kotlarski
c812288ab7 Fix small issues with forward search and add report progress. 2013-03-29 17:42:28 +02:00
Andrey Kotlarski
81e4fe19ac Merge branch 'search' of https://github.com/m00natic/vlfi into search
Conflicts:
	vlfi.el
2013-03-29 16:04:26 +02:00
Andrey Kotlarski
853386f82e Add regex search forward functionality. 2013-03-29 16:02:34 +02:00
Andrey Kotlarski
0dd4ba87aa Add regex search forward functionality. 2013-03-29 15:53:39 +02:00
Andrey Kotlarski
e693e8f24a Disable undo information for VLFI buffers. 2013-03-29 15:53:15 +02:00
Andrey Kotlarski
c3051e6131 Show file position in percentages. 2013-03-29 15:52:55 +02:00
Andrey Kotlarski
c0d143b632 Rename vlf to vlfi and update README. 2013-02-02 16:12:30 +02:00
Andrey Kotlarski
e3087a8531 Rename vlf.el. 2013-02-02 16:08:57 +02:00
3 changed files with 1007 additions and 137 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.elc
*~

View File

@@ -1,4 +1,99 @@
* View Large File
* View Large Files
An Emacs mode that allows viewing files in chunks. This is a fork
that builds on the GNU ELPA vlf.el.
Emacs minor mode that allows viewing, editing and searching large
files in batches. Batch size can be adjusted on the fly and bounds
the memory that is to be used for operations on the file.
This is development version of the GNU ELPA [[http://elpa.gnu.org/packages/vlf][vlf.el]] package. Here's
what it does in a nutshell:
- regular expression search on whole file (in constant memory
determined by current batch size)
- chunk editing (if size has changed, saving is done in constant
memory determined by current batch size)
- occur like indexing
- options to jump to beginning, end or arbitrary file chunk
- ability to jump/insert given number of batches at once
- newly added content is acknowledged if file has changed size
meanwhile
- automatic scrolling of batches
- VLF is added as an option when opening large files
GNU Emacs 23 and 24 are supported.
* Overview and tips
M-x vlf PATH-TO-FILE
** Unicode
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.
** 32-bit GNU Emacs
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), VLF will probably not quite work.
** Memory control
*vlf-batch-size* bounds the memory used for all operations.
* Detail usage
** Control batch size
*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
*C-c C-v PgUp* and *C-c C-v PgDn* move batch by batch. With positive
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.
*C-c C-v j* jumps to given chunk. To see where you are in file and
how many chunks there are (using the current batch size), look at the
parenthesized part of the buffer name, batch size is also indicated at
the end.
** Search whole file
*C-c C-v s* and *C-c C-v r* search forward and backward respectively
over the whole file. This is done batch by batch so if you have
really huge file - you'd better set somewhat bigger batch size
beforehand.
** Occur over whole file
*C-c C-v o* builds index for given regular expression just like
*M-x occur*. It does this batch by batch 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.
** Jump to line
*C-c C-v l* jumps to given line in file. This is done by searching
from the beginning, so again the bigger current batch size, the
quicker. With negative argument, lines are counted from the end of
file.
** Reload
*C-c C-v g* discards modifications (if such) and reloads chunk.
** Edit and save
If editing doesn't change size of the chunk, only this chunk is saved.
Otherwise the remaining part of the file is adjusted batch by batch,
so again you'd better have bigger current batch size.

1041
vlf.el

File diff suppressed because it is too large Load Diff