View Large Files from Mathias Dahl
complete rewrite by Sam Steingold
fix vlf-change-batch-size binding
vlf.el: Improve commentary.
hook into dired
* packages/vlf/vlf.el: Use lexical-binding.  Bump version to 0.3.
Add ability to view newly added content if the file has grown meanwhile.
Provide a V binding in dired.
(vlf-mode-map): Change C-+ to M-+.  Add M-- binding.
(vlf-next-batch, vlf-prev-batch): Add ability to jump/insert given number of
batches at once.
(vlf): Add autoload cookie.  Add option to start viewing from the end of file.
(dired-vlf): New function.
(vlf-if-file-too-large): New function.
(abort-if-file-too-large): Use it to provide vlf as an option when opening
large files.
* packages/vlf/vlf.el: Version 0.4.
(vlf-mode-map): Add bindings to search and jump to BOF/EOF.
(vlf-format-buffer-name): Change position into a percentage.
(vlf-next-batch, vlf-prev-batch): Keep stable cursor position when moving
through chunks.
(vlf-move-to-chunk, vlf-insert-file): New functions.
(vlf): Use them.  Disable undo information.  Change arg order.
(dired-vlf): Adjust call.
(vlf-re-search-forward, vlf-re-search-backward, vlf-end-search): New functions.
* packages/vlf/vlf.el: Version 0.5
Add editing mode.  Search refinements.
(vlf-mode-map): Change keys for batch size and EOF/BOF jumps.
(vlf-mode): Move buffer-disable-undo here.
(vlf-move-to-chunk): New function.
(vlf-change-batch-size): Use it to immediately update content.
(vlf-if-file-too-large): Adjust call (missed in last change).
(vlf-re-search, vlf-goto-match): New functions.
(vlf-re-search-forward, vlf-re-search-backward): Use them.
(vlf-end-search): Remove function.
(vlf-edit-mode-map): New var.
(vlf-edit-mode): New major mode.
(vlf-write, vlf-discard-edit): New commands.
* packages/vlf/vlf.el: Version 0.6
(vlf-mode): Setup revert and file write.
(vlf-format-buffer-name): Change format to indicate the chunk numbers.
(vlf-insert-file): Remove unused arg `file'.
(vlf-beginning-of-file, vlf-end-of-file, vlf-jump-to-chunk): New commands.
(vlf-mode-map): Use them.  Add a `j' binding.
(vlf-revert): New function.
(vlf-next-batch, vlf-prev-batch, vlf-move-to-batch, vlf-move-to-chunk):
Set modtime.  Better preserve point.
(vlf-file-shift-back, vlf-shift-batch, vlf-file-shift-forward)
(vlf-shift-batches): New functions.
(vlf-write): Use them when size of saved chunks has changed.
Pay attention to modtimes.
* packages/vlf/vlf.el: Version 0.7
(vlf-goto-line): New command.
(vlf-mode-map): Bind it to `l'.
(vlf-mode): Don't affect the global value of revert-buffer-function.
(vlf, dired-vlf): Remove `from-end' argument.
(scroll-up, scroll-down): Add advice to auto-jump to the next batch
during scrolling.
(vlf-get-file-size): New macro.
(vlf-revert): Try and pay attention to the actual arguments.
(vlf-next-batch, vlf-prev-batch, vlf-move-to-batch, vlf-move-to-chunk)
(vlf-re-search, vlf-goto-match): Use position-bytes to try and match bytes
and chars.
(vlf-adjust-chunk): New function.
(vlf-file-shift-back): Disable undo.  Don't mess with
buffer-file-coding-system, use coding-system-for-write instead.
(vlf-shift-batch): Check modtime.
(vlf-file-shift-forward): Simplify.
(vlf-shift-batches): Don't use an auxiliary buffer.
* packages/vlf/vlf.el: Version 0.8, Add occur-like functionality.
(vlf-occur-mode-map): New var.
(vlf-occur-mode): New major mode.
(vlf-occur-next-match, vlf-occur-prev-match, vlf-occur-visit, vlf-occur):
New commands.
(vlf-build-occur): New function.
(vlf-mode-map): Add `o' binding for vlf-occur.
* packages/vlf/vlf.el: Version 0.9.
(vlf-end-pos): Default to 0.
(vlf): Set the major mode earlier.
(vlf-get-file-size): Make it into a function.
(vlf-re-search): Add `batch-step' argument.
(vlf-re-search-forward, vlf-re-search-backward): Use it.
(vlf-goto-line): Make it handle a negative arg.
(vlf-occur-show): New command.
(vlf-occur-mode-map): Bind it to `o'.
(vlf-occur-visit): Don't switch-to-buffer.
(vlf-occur): Protect against non-local exits.
(vlf-build-occur): Fix details.
(vlf-edit-mode-map): Bind standard map to C-v.
(vlf-discard-edit): Mark buffer as unmodified.
* packages/vlf/vlf.el: Set "Maintainer:".
	* packages/vlf/vlf.el:: Version 0.9.1.
	Add development repository URL.
	(vlf-encode-size): New variable.
	(vlf-adjust-chunk): Allow fluctuation when searching for proper
	decoding.  Save encoded size to `vlf-encode-size'.
	(vlf-write): Use `vlf-encode-size' for expected encoding size.
	(vlf-batch-size, vlf-start-pos, vlf-end-pos, vlf-file-size)
	(vlf-encode-size): Move permanent declarations to top level.
	(vlf-mode): Fix locality of `write-file-functions' hook.
	(vlf): Use `set-visited-file-name'.
	(abort-if-file-too-large): Make `vlf-if-file-too-large' around
	advice.
	(scroll-up, scroll-down): Use `derived-mode-p'.
	(vlf-change-batch-size): Remove superfluous check.
	(vlf-verify-size): New function.
	(vlf-next-batch, vlf-move-to-batch, vlf-move-to-chunk)
	(vlf-file-shift-back, vlf-shift-batch, vlf-shift-batches): Use
	it.
	(vlf-revert): Fix boolean condition and ignored variable naming.
	(vlf-prev-batch): Style fix.
	* packages/vlf/vlf.el: Fix URL.
	* packages/vlf/vlf.el: Version 1.0
	Turn VLF into minor mode and abstract chunk insertion.
	(vlf-encode-size, vlf-format-buffer-name, vlf-edit-mode-map)
	(vlf-edit-mode): Remove.
	(vlf-mode-map): Turn into prefix map, add new bindings.
	(vlf-mode): Turn into minor mode.
	(vlf): Call vlf-mode.
	(scroll-up): Scroll when point-max is visible.
	(scroll-down): Scroll when point-min is visible.
	(vlf-update-buffer-name): Hide total file size.
	(vlf-insert-file): Refactor.
	(vlf-revert): Use vlf-move-to-chunk-2.
	(vlf-with-undo-disabled): New macro.
	(vlf-file-shift-back, vlf-file-shift-forward): Use it.
	(vlf-no-modifications): New function.
	(vlf-re-search-forward, vlf-re-search-backward, vlf-goto-line):
	Use it.
	(vlf-next-batch, vlf-prev-batch, vlf-move-to-batch): Simplify with
	vlf-move-to-chunk.
	(vlf-next-batch-from-point, vlf-occur-visit-new-buffer): New
	commands.
	(vlf-move-to-chunk-1, vlf-move-to-chunk-2): New functions.
	(vlf-move-to-chunk): Use them.
	(vlf-adjust-chunk): Specify region and adjust end too.
	(vlf-re-search): Ignore case and remove assert.
	(vlf-goto-match): Guarantee highlight removal.
	(vlf-occur-visit): Reuse existing VLF buffer if possible and add
	ability to explicitly open in new VLF buffer.
	(vlf-occur): Use temporary VLF buffer to index if current is
	modified.
	(vlf-build-occur): Ignore case and get buffer to be indexed as
	argument.
	(vlf-discard-edit): Rename to vlf-refresh.
	(vlf-write): Use vlf-end-pos and vlf-start-pos to calculate size
	change.
	* packages/vlf/vlf.el: Version 1.1
	Stabilize decoding and saving.  Optimize moving between
	overlapping chunks.
	(vlf-mode): Forbid automatic final new line.  Improve reloading of
	all content.
	(vlf-move-to-chunk): Always use vlf-move-to-chunk-1.
	(vlf-move-to-chunk-1): Use vlf-with-undo-disabled.  Fix length
	calculation when deleting from buffer.
	(vlf-partial-decode-shown-p): New function.
	(vlf-adjust-chunk): Use it.  Fix end adjustment for earlier GNU
	Emacs releases.
	(vlf-refresh): Use vlf-move-to-chunk-2.
	* packages/vlf/vlf.el: Version: 1.2
	Add ability to customize when VLF is offered and activated.
	(vlf-application, vlf-forbidden-modes-list): New customizations.
	(vlf-mode-map): Change bindings.
	(vlf-prefix-map): New map.
	(vlf-with-undo-disabled): Move it before its first use to fix
	package installation.
	(vlf-mode): Initialize vlf-start-pos and vlf-end-pos.
	(vlf-determine-major-mode): New function.
	(abort-if-file-too-large): Add support for VLF application
	customization and fix it for GNU Emacs 23.
	(vlf-get-file-size): Return 0 in case file size is missing.
	(vlf-verify-size): Fix file size determination for symlinks by
	using buffer-file-truename.
	(vlf-revert): Turn into command.  Stop spurious questions.
	(vlf-next-batch-from-point): Fix in case end of file is near.
	(vlf-move-to-chunk-1): Fix behaviour for unsaved new files and
	point jumps.
	(vlf-refresh): Remove.
	(vlf-write): Fix behaviour for first save of new file.
Add comments for autoloaded elements.
	* packages/vlf/vlf.el: Add recenter around chunk functionality.

	(vlf-follow-timer): New variable.
	(vlf-partial-decode-shown, vlf-min-chunk-size): New constants.
	(vlf-with-undo-disabled): Restore previous undo list.
	(vlf-shift-undo-list): New function.
	(vlf-mode): Stop follow timer if active.
	("etags"): Don't apply automatically VLF over TAGS files.
	(vlf-move-to-chunk, vlf-move-to-chunk-1, vlf-move-to-chunk-2):
	Return number of bytes added to beginning and end for proper
	decoding.
	(vlf-move-to-chunk-1): Adjust undo list when chunk start has
	changed.  Ignore moving by just a few bytes.
	(vlf-adjust-start, vlf-adjust-end, vlf-insert-content-safe): New functions.
	(vlf-adjust-chunk): Use them.  Rename to `vlf-insert-file-contents'.
	(vlf-recenter): New function.
	(vlf-stop-following, vlf-start-following): New commands.