[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 0dc6d06 190/310: Completely decouple vlf integratio
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 0dc6d06 190/310: Completely decouple vlf integration from other functionality. |
Date: |
Sat, 28 Nov 2020 00:33:13 -0500 (EST) |
branch: externals/vlf
commit 0dc6d0643e09e20175637215401b3191f6f8729e
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Completely decouple vlf integration from other functionality.
---
README.org | 10 ++++++++--
vlf-base.el | 5 +++++
vlf.el | 16 ++++++++++------
3 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/README.org b/README.org
index 538d44f..4c6abac 100644
--- a/README.org
+++ b/README.org
@@ -47,7 +47,13 @@ integer value).
** Applicability
-You can control when vlf-mode is invoked or offered as choice with the
+To have *vlf* offered as choice when opening large files:
+
+#+BEGIN_EXAMPLE
+(require 'vlf-integrate)
+#+END_EXAMPLE
+
+You can control when vlf-mode is invoked or offered with the
*vlf-application* customization option. By default it will offer VLF
when opening large files. There are also options to never use it (you
can still call *vlf* command explicitly); to use it without asking for
@@ -70,7 +76,7 @@ To disable automatic usage of VLF for a function, for example
named
*func* defined in file *file.el*:
#+BEGIN_EXAMPLE
-(vlf-disable-for-function func "file.el")
+(vlf-disable-for-function func "file")
#+END_EXAMPLE
** Keymap
diff --git a/vlf-base.el b/vlf-base.el
index fbc27ba..e78c199 100644
--- a/vlf-base.el
+++ b/vlf-base.el
@@ -35,6 +35,11 @@
(t ;; TODO: use (< emacs-minor-version 4) after 24.4 release
(string-lessp emacs-version "24.3.5")))
"Indicates whether partial decode codes are displayed.")
+(unless (fboundp 'file-size-human-readable)
+ (defun file-size-human-readable (file-size)
+ "Print FILE-SIZE in MB."
+ (format "%.3fMB" (/ file-size 1048576.0))))
+
(defun vlf-move-to-chunk (start end &optional minimal)
"Move to chunk determined by START END.
diff --git a/vlf.el b/vlf.el
index 467bece..015f67a 100644
--- a/vlf.el
+++ b/vlf.el
@@ -26,10 +26,12 @@
;; Boston, MA 02111-1307, USA.
;;; Commentary:
-;; This package provides the M-x vlf command, which visits part of a
-;; large file without loading the entire file.
-;; The buffer uses VLF mode, which defines several commands for
+;; This package provides the M-x vlf command, which visits part of
+;; large file without loading it entirely.
+;; The buffer uses VLF mode, which provides several commands for
;; moving around, searching and editing selected part of file.
+;; To have it offered when opening large files:
+;; (require 'vlf-integrate)
;; This package was inspired by a snippet posted by Kevin Rodgers,
;; showing how to use `insert-file-contents' to extract part of a
@@ -37,11 +39,13 @@
;;; Code:
-;;;###autoload
-(require 'vlf-integrate)
-
(require 'vlf-base)
+(defgroup vlf nil
+ "View Large Files in Emacs."
+ :prefix "vlf-"
+ :group 'files)
+
(defcustom vlf-batch-size 1024
"Defines how large each batch of file data is (in bytes)."
:group 'vlf
- [elpa] externals/vlf 9b22b74 134/310: Add gitignore., (continued)
- [elpa] externals/vlf 9b22b74 134/310: Add gitignore., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 2dba838 140/310: In case original VLF buffer has been killed, try to find existing VLF, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf efae918 138/310: Turn vlf into minor mode., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf e36492b 182/310: Optimize chunk jumping for current GNU Emacs releases. Fix moving by, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f1ade81 069/310: Add go to line command., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 3fb898e 070/310: Add automatic batching when scrolling., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf fc689d5 071/310: Make coding system conversion on write more idiomatic., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 74febeb 072/310: Remove ability to launch VLFI from file end. It's superseded by, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 4699008 074/310: Make chunk adjusting automatic., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 538a9e6 075/310: Apply chunk decoding adjustment implicitly., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0dc6d06 190/310: Completely decouple vlf integration from other functionality.,
Stefan Monnier <=
- [elpa] externals/vlf c533bce 207/310: Add command to set batch size explicitly., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 177c680 147/310: Revert to showing batch size in buffer name instead of the mode-line., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d6c7223 151/310: Delete obsolete vlfi.el., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 655805c 174/310: Fix vlf-next-batch-from-point behaviour near end of file., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf db1da30 175/310: Use buffer-file-truename for file size determination and remove, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 429a8ff 196/310: Widen region when measuring encoded content length., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf df8c9ea 191/310: Detect change of file when loading chunk and act more cautiously. Move, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf cc9b115 214/310: Update docstring for vlf-ediff-adjust., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 82fd5b9 203/310: Refine diff adjustment and in case of equality after it - make another, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0199c24 218/310: Lower tramp verbosity level when dealing with multiple batches., Stefan Monnier, 2020/11/28