[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 0080991 154/310: Fix chunk end adjustment and save
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 0080991 154/310: Fix chunk end adjustment and save for trunk Emacs. |
Date: |
Sat, 28 Nov 2020 00:33:06 -0500 (EST) |
branch: externals/vlf
commit 0080991fa9a1906c3ca1c1d3d1d937eeec847256
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Fix chunk end adjustment and save for trunk Emacs.
---
vlf.el | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/vlf.el b/vlf.el
index 101c8dd..385468f 100644
--- a/vlf.el
+++ b/vlf.el
@@ -90,6 +90,7 @@
:keymap vlf-mode-map
(if vlf-mode
(progn
+ (set (make-local-variable 'require-final-newline) nil)
(add-hook 'write-file-functions 'vlf-write nil t)
(set (make-local-variable 'revert-buffer-function)
'vlf-revert)
@@ -108,6 +109,7 @@
(y-or-n-p (format "Load whole file (%s)? "
(file-size-human-readable
vlf-file-size))))
+ (kill-local-variable 'require-final-newline)
(remove-hook 'write-file-functions 'vlf-write t)
(let ((pos (+ vlf-start-pos (position-bytes (point)))))
(vlf-with-undo-disabled
@@ -431,7 +433,7 @@ Return t if move hasn't been canceled."
position)
"Adjust chunk at absolute START to END till content can be \
properly decoded. ADJUST-START determines if trying to prepend bytes\
- to the beginning, ADJUST-END - add to the end.
+ to the beginning, ADJUST-END - append to the end.
Use buffer POSITION as start if given.
Return number of bytes moved back for proper decoding and number of
bytes added to the end."
@@ -456,20 +458,14 @@ bytes added to the end."
(insert-file-contents buffer-file-name nil start end)))
;; adjust end
(when (and adjust-end (< end vlf-file-size))
- (let ((expected-size (buffer-size)))
+ (let ((expected-size (buffer-size))) ; in case partial symbol is not
displayed
(while (and (= expected-size (buffer-size))
(< end vlf-file-size))
(setq shift-end (1+ shift-end)
end (1+ end))
(delete-region position (point-max))
(goto-char position)
- (insert-file-contents buffer-file-name nil start end)))
- (when (< end vlf-file-size)
- (setq shift-end (1- shift-end)
- end (1- end))
- (delete-region position (point-max))
- (goto-char position)
- (insert-file-contents buffer-file-name nil start end)))
+ (insert-file-contents buffer-file-name nil start end))))
(cons shift-start shift-end)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- [elpa] externals/vlf 2d71996 125/310: Add end character shift when adjusting chunk. Apply partial chunk, (continued)
- [elpa] externals/vlf 2d71996 125/310: Add end character shift when adjusting chunk. Apply partial chunk, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 737c1e9 126/310: Remove encode size bookkeeping., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d1b34dc 127/310: Add autoload cookie for `file-size-human-readable' not to break GNU, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 4c631bc 129/310: Rename vlfi.el to vlf.el., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 17c6612 130/310: Rename anything vlfi -> vlf., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf bc68eed 131/310: Add dummy vlfi.el that urges move to the vlf package., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 025399a 133/310: Merge branch 'master' into keep-edit, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f34986a 142/310: Update README., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 931ca52 145/310: Stylistic refinements., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 2ac3e7d 146/310: Fix prematurely ending search/occur not to ask for modified buffer, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0080991 154/310: Fix chunk end adjustment and save for trunk Emacs.,
Stefan Monnier <=
- [elpa] externals/vlf a3901b8 157/310: Fix deletion when moving to partially overlapping chunk and enable more, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 371c560 158/310: Bump version and remove warning - save is now reliable., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf c68c34e 160/310: Add vlf-application customization which refines control over when, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a0cafa7 161/310: Explicitly offer vlf-prefix-map so user can easily define another prefix, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ea46386 168/310: Don't apply VLF by default over image and pdf files., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 2470fc0 181/310: Fix vlf-shift-undo-list to reverse resulting list., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 161a4ec 184/310: Prevent inserting of too small file regions for GNU Emacs later than, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 95e6259 188/310: Add convenience macro to disable VLF application during execution of, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 66db665 189/310: Fix follow functionality and explicitly set variable as buffer local., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 38e8f6c 199/310: Update file size when moving to end of buffer., Stefan Monnier, 2020/11/28