[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 429a8ff 196/310: Widen region when measuring encode
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 429a8ff 196/310: Widen region when measuring encoded content length. |
Date: |
Sat, 28 Nov 2020 00:33:14 -0500 (EST) |
branch: externals/vlf
commit 429a8ff01648f72a551dd1ab02ba6348ac2c80d9
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Widen region when measuring encoded content length.
---
vlf-base.el | 9 +++++----
vlf-write.el | 1 +
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/vlf-base.el b/vlf-base.el
index 578891f..a2ad0e0 100644
--- a/vlf-base.el
+++ b/vlf-base.el
@@ -106,6 +106,7 @@ bytes added to the end."
"Move to chunk enclosed by START END keeping as much edits if any.
Return number of bytes moved back for proper decoding and number of
bytes added to the end."
+ (widen)
(let* ((modified (buffer-modified-p))
(start (max 0 start))
(end (min end vlf-file-size))
@@ -133,8 +134,8 @@ bytes added to the end."
(inhibit-read-only t))
(cond ((< end edit-end)
(let* ((del-pos (1+ (or (byte-to-position
- (- end vlf-start-pos))
- 0)))
+ (- end vlf-start-pos))
+ 0)))
(del-len (length (encode-coding-region
del-pos (point-max)
buffer-file-coding-system
@@ -303,8 +304,8 @@ Return number of bytes added over expected."
(insert-file-contents-literally buffer-file-name nil start end)
(let ((coding-system-for-read coding))
(decode-coding-inserted-region position (point-max)
- buffer-file-name nil start end))
- (setq buffer-file-coding-system last-coding-system-used)))
+ buffer-file-name nil start end)))
+ (setq buffer-file-coding-system last-coding-system-used))
(defun vlf-shift-undo-list (n)
"Shift undo list element regions by N."
diff --git a/vlf-write.el b/vlf-write.el
index f1257d3..7e9d069 100644
--- a/vlf-write.el
+++ b/vlf-write.el
@@ -44,6 +44,7 @@ Save anyway? "))
buffer-file-truename)
vlf-end-pos vlf-file-size)
(vlf-update-buffer-name))
+ (widen)
(let* ((region-length (length (encode-coding-region
(point-min) (point-max)
buffer-file-coding-system t)))
- [elpa] externals/vlf fc689d5 071/310: Make coding system conversion on write more idiomatic., (continued)
- [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, 2020/11/28
- [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 <=
- [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
- [elpa] externals/vlf ee19f81 228/310: Load hexl advices after load and move vlf group definition., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 2c231df 226/310: Disable hexl-save-buffer and hexl revert when vlf-mode is active., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a1ca1e3 232/310: Don't launch vlf when file size is less than vlf-batch-size., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf facdb9f 249/310: Fix binary tune base case and add approximation after access to, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d67825c 244/310: Move back to using average speed when measuring and tuning. Be more, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf e3be8d5 079/310: Don't adjust chunk with more that 3 bytes and inhibit spurious update, Stefan Monnier, 2020/11/28