[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 9343095 193/310: Fix installation interfile depende
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 9343095 193/310: Fix installation interfile dependencies and fix setting of local |
Date: |
Sat, 28 Nov 2020 00:33:14 -0500 (EST) |
branch: externals/vlf
commit 9343095096e844f323f3d21b25b2aaef1ab173ed
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Fix installation interfile dependencies and fix setting of local
variables for GNU Emasc 23.
---
vlf-base.el | 25 +++++++++++++++
vlf-follow.el | 5 +++
vlf-integrate.el | 2 ++
vlf-occur.el | 7 ++++-
vlf-search.el | 5 +++
vlf-write.el | 5 +++
vlf.el | 96 +++++++++++++++++++++-----------------------------------
7 files changed, 84 insertions(+), 61 deletions(-)
diff --git a/vlf-base.el b/vlf-base.el
index 124ee56..d06d03f 100644
--- a/vlf-base.el
+++ b/vlf-base.el
@@ -27,6 +27,31 @@
;;; Code:
+(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
+ :type 'integer)
+(put 'vlf-batch-size 'permanent-local t)
+
+;;; Keep track of file position.
+(defvar vlf-start-pos 0
+ "Absolute position of the visible chunk start.")
+(make-variable-buffer-local 'vlf-start-pos)
+(put 'vlf-start-pos 'permanent-local t)
+
+(defvar vlf-end-pos 0 "Absolute position of the visible chunk end.")
+(make-variable-buffer-local 'vlf-end-pos)
+(put 'vlf-end-pos 'permanent-local t)
+
+(defvar vlf-file-size 0 "Total size of presented file.")
+(make-variable-buffer-local 'vlf-file-size)
+(put 'vlf-file-size 'permanent-local t)
+
(defconst vlf-sample-size 24
"Minimal number of bytes that can be properly decoded.")
diff --git a/vlf-follow.el b/vlf-follow.el
index 1716faa..e6740f2 100644
--- a/vlf-follow.el
+++ b/vlf-follow.el
@@ -27,6 +27,11 @@
;;; Code:
+(eval-when-compile
+ (add-to-list 'load-path default-directory))
+
+(require 'vlf)
+
(defvar vlf-follow-timer nil
"Contains timer if vlf buffer is set to continuously recenter.")
(make-variable-buffer-local 'vlf-follow-timer)
diff --git a/vlf-integrate.el b/vlf-integrate.el
index cf21898..8ead400 100644
--- a/vlf-integrate.el
+++ b/vlf-integrate.el
@@ -84,6 +84,8 @@ Possible values are: nil to never use it;
(cadr mode)
mode)))
+(autoload 'vlf "vlf" "View Large FILE in batches.")
+
(defadvice abort-if-file-too-large (around vlf-if-file-too-large
compile activate)
"If file SIZE larger than `large-file-warning-threshold', \
diff --git a/vlf-occur.el b/vlf-occur.el
index b8e96e1..71a2fc5 100644
--- a/vlf-occur.el
+++ b/vlf-occur.el
@@ -27,6 +27,11 @@
;;; Code:
+(eval-when-compile
+ (add-to-list 'load-path default-directory))
+
+(require 'vlf)
+
(defvar vlf-occur-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "n" 'vlf-occur-next-match)
@@ -126,7 +131,7 @@ Prematurely ending indexing will still show what's found so
far."
(with-temp-buffer
(setq buffer-file-name file)
(set-buffer-modified-p nil)
- (setq-local vlf-batch-size batch-size)
+ (set (make-local-variable 'vlf-batch-size) batch-size)
(vlf-mode 1)
(goto-char (point-min))
(vlf-with-undo-disabled
diff --git a/vlf-search.el b/vlf-search.el
index 25063c1..26ca0d0 100644
--- a/vlf-search.el
+++ b/vlf-search.el
@@ -27,6 +27,11 @@
;;; Code:
+(eval-when-compile
+ (add-to-list 'load-path default-directory))
+
+(require 'vlf)
+
(defun vlf-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."
diff --git a/vlf-write.el b/vlf-write.el
index f473742..25e9419 100644
--- a/vlf-write.el
+++ b/vlf-write.el
@@ -27,6 +27,11 @@
;;; Code:
+(eval-when-compile
+ (add-to-list 'load-path default-directory))
+
+(require 'vlf-base)
+
(defun vlf-write ()
"Write current chunk to file. Always return true to disable save.
If changing size of chunk, shift remaining file content."
diff --git a/vlf.el b/vlf.el
index cfa06ae..f3dc76c 100644
--- a/vlf.el
+++ b/vlf.el
@@ -39,32 +39,10 @@
;;; Code:
-(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
- :type 'integer)
-(put 'vlf-batch-size 'permanent-local t)
-
-;;; Keep track of file position.
-(defvar vlf-start-pos 0
- "Absolute position of the visible chunk start.")
-(make-variable-buffer-local 'vlf-start-pos)
-(put 'vlf-start-pos 'permanent-local t)
+(eval-when-compile
+ (add-to-list 'load-path default-directory))
-(defvar vlf-end-pos 0 "Absolute position of the visible chunk end.")
-(make-variable-buffer-local 'vlf-end-pos)
-(put 'vlf-end-pos 'permanent-local t)
-
-(defvar vlf-file-size 0 "Total size of presented file.")
-(make-variable-buffer-local 'vlf-file-size)
-(put 'vlf-file-size 'permanent-local t)
+(require 'vlf-base)
(autoload 'vlf-write "vlf-write" "Write current chunk to file.")
(autoload 'vlf-re-search-forward "vlf-search"
@@ -114,9 +92,10 @@
:keymap vlf-prefix-map
(if vlf-mode
(progn
- (setq-local require-final-newline nil)
+ (set (make-local-variable 'require-final-newline) nil)
(add-hook 'write-file-functions 'vlf-write nil t)
- (setq-local revert-buffer-function 'vlf-revert)
+ (set (make-local-variable 'revert-buffer-function)
+ 'vlf-revert)
(make-local-variable 'vlf-batch-size)
(setq vlf-file-size (vlf-get-file-size buffer-file-truename)
vlf-start-pos 0
@@ -153,6 +132,36 @@ You can customize number of bytes displayed by customizing
(vlf-mode 1)
(switch-to-buffer (current-buffer))))
+(defun vlf-next-batch (append)
+ "Display the next batch of file data.
+When prefix argument is supplied and positive
+ jump over APPEND number of batches.
+When prefix argument is negative
+ append next APPEND number of batches to the existing buffer."
+ (interactive "p")
+ (vlf-verify-size)
+ (let* ((end (min (+ vlf-end-pos (* vlf-batch-size (abs append)))
+ vlf-file-size))
+ (start (if (< append 0)
+ vlf-start-pos
+ (- end vlf-batch-size))))
+ (vlf-move-to-chunk start end)))
+
+(defun vlf-prev-batch (prepend)
+ "Display the previous batch of file data.
+When prefix argument is supplied and positive
+ jump over PREPEND number of batches.
+When prefix argument is negative
+ append previous PREPEND number of batches to the existing buffer."
+ (interactive "p")
+ (if (zerop vlf-start-pos)
+ (error "Already at BOF"))
+ (let* ((start (max 0 (- vlf-start-pos (* vlf-batch-size (abs prepend)))))
+ (end (if (< prepend 0)
+ vlf-end-pos
+ (+ start vlf-batch-size))))
+ (vlf-move-to-chunk start end)))
+
;; scroll auto batching
(defadvice scroll-up (around vlf-scroll-up
activate compile)
@@ -225,39 +234,6 @@ Ask for confirmation if NOCONFIRM is nil."
(error "Save or discard your changes first")
t))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; batch movement
-
-(defun vlf-next-batch (append)
- "Display the next batch of file data.
-When prefix argument is supplied and positive
- jump over APPEND number of batches.
-When prefix argument is negative
- append next APPEND number of batches to the existing buffer."
- (interactive "p")
- (vlf-verify-size)
- (let* ((end (min (+ vlf-end-pos (* vlf-batch-size (abs append)))
- vlf-file-size))
- (start (if (< append 0)
- vlf-start-pos
- (- end vlf-batch-size))))
- (vlf-move-to-chunk start end)))
-
-(defun vlf-prev-batch (prepend)
- "Display the previous batch of file data.
-When prefix argument is supplied and positive
- jump over PREPEND number of batches.
-When prefix argument is negative
- append previous PREPEND number of batches to the existing buffer."
- (interactive "p")
- (if (zerop vlf-start-pos)
- (error "Already at BOF"))
- (let* ((start (max 0 (- vlf-start-pos (* vlf-batch-size (abs prepend)))))
- (end (if (< prepend 0)
- vlf-end-pos
- (+ start vlf-batch-size))))
- (vlf-move-to-chunk start end)))
-
(defun vlf-move-to-batch (start &optional minimal)
"Move to batch determined by START.
Adjust according to file start/end and show `vlf-batch-size' bytes.
- [elpa] externals/vlf 51d95ec 152/310: Add command to display batch starting from point., (continued)
- [elpa] externals/vlf 51d95ec 152/310: Add command to display batch starting from point., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 46e39a0 153/310: Version 1.0., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d1af56d 167/310: Fix opening of files for GNU Emacs 23., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 8ab1c6a 136/310: Disable undo and mark buffer as not modified when invoking search or, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf bb482f0 173/310: Fix file size determination for symbolic links., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9ffb968 172/310: Remove defadvice abort-if-file-too-large argument list so it works, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 386d856 179/310: Restore undo information after temporarily disabling it., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf deec75d 186/310: Enlarge minimum sample chunk for decoding size., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 516584e 187/310: Break VLF into components., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 27e3bbb 201/310: Reuse initial ediff session for all chunks., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9343095 193/310: Fix installation interfile dependencies and fix setting of local,
Stefan Monnier <=
- [elpa] externals/vlf 88dba8b 195/310: Remove unnecessary addition to load-path on compile., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf dd43af5 192/310: Manually decode and use several bytes buffer when loading chunk., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 98ddc3a 198/310: Add by batch Ediff functionality., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9646b00 202/310: Adjust chunk borders to minimize shift differences and optimize, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d5d9cd7 205/310: Improve refining of differences and readjustment., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0fa8e8d 210/310: Update buffer name on user interruption during ediff., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 30d2bb0 208/310: VLF buffer ediff now starts from the current chunks., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f83a212 213/310: Temporarily disable font-lock during multiple batch operations., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 074f9e9 221/310: Play nicely with hexl-mode., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 8c61b77 222/310: Fix when batch hooks are run for occur and save., Stefan Monnier, 2020/11/28