[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 55e0c40 300/310: Explicitly set coding-system-for-r
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 55e0c40 300/310: Explicitly set coding-system-for-read to the current coding when not |
Date: |
Sat, 28 Nov 2020 00:33:36 -0500 (EST) |
branch: externals/vlf
commit 55e0c404c802c4cf056a8dde94a77df2970a42c7
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Explicitly set coding-system-for-read to the current coding when not
inserting from the beginning.
---
vlf-base.el | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/vlf-base.el b/vlf-base.el
index 701506d..1c1c8e2 100644
--- a/vlf-base.el
+++ b/vlf-base.el
@@ -1,6 +1,6 @@
;;; vlf-base.el --- VLF primitive operations -*- lexical-binding: t -*-
-;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2017 Free Software Foundation, Inc.
;; Keywords: large files, chunk
;; Author: Andrey Kotlarski <m00naticus@gmail.com>
@@ -270,9 +270,11 @@ 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."
- (setq adjust-start (and adjust-start (not (zerop start)))
- adjust-end (and adjust-end (/= end vlf-file-size))
+ (setq adjust-end (and adjust-end (/= end vlf-file-size))
position (or position (point-min)))
+ (and adjust-start (<= start 4)
+ (setq adjust-start nil
+ start 0))
(goto-char position)
(let ((shift-start 0)
(shift-end 0)
@@ -294,7 +296,10 @@ bytes added to the end."
(defun vlf-insert-file-contents-1 (start end)
"Extract decoded file bytes START to END."
- (vlf-tune-insert-file-contents start end))
+ (if (zerop start)
+ (vlf-tune-insert-file-contents start end)
+ (let ((coding-system-for-read buffer-file-coding-system))
+ (vlf-tune-insert-file-contents start end))))
(defun vlf-adjust-start (start end position adjust-end)
"Adjust chunk beginning at absolute START to END till content can\
@@ -307,9 +312,10 @@ Return number of bytes moved back for proper decoding."
(strict (or (= sample-end vlf-file-size)
(and (not adjust-end) (= sample-end end))))
(shift 0))
- (while (and (progn (insert-file-contents buffer-file-name
- nil safe-start sample-end)
- (not (zerop safe-start)))
+ (while (and (let ((coding-system-for-read buffer-file-coding-system))
+ (insert-file-contents buffer-file-name
+ nil safe-start sample-end)
+ (not (zerop safe-start)))
(< shift 3)
(let ((diff (- chunk-size
(length
- [elpa] externals/vlf e4a2e80 266/310: Optimize goto-line for hexl-mode, no need to search., (continued)
- [elpa] externals/vlf e4a2e80 266/310: Optimize goto-line for hexl-mode, no need to search., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 7b9befe 275/310: - don't load unnecessary data at the end of search or occur, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 842569a 270/310: Add ability to use temporary file when adjusting content on save., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d579b7b 279/310: Workaround local maximum in batch tune., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf b14c912 290/310: Copy around buffer specific profile vectors when forking new buffers., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf b300137 292/310: Encode smaller region to detect cut point overall offset in vlf-occur, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 86be483 293/310: Improve search precision., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a8ba836 298/310: Fix issue where tramp-verbose is bound to nil., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 25e16ef 303/310: Fix broken link in README, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf b62bc04 301/310: Issue 31 Make vlf-batch-size configurable in the remote case, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 55e0c40 300/310: Explicitly set coding-system-for-read to the current coding when not,
Stefan Monnier <=
- [elpa] externals/vlf 4eaf763 297/310: Rename vlf-integrate.el to vlf-setup.el, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf efffeb5 310/310: Bump vlf version after previous fix, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f4aa108 308/310: * vlf.el: Use GPL version 3, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f4ee23c 156/310: Fix chunk end adjustment and save for current and older Emacsen., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 2e2bca6 169/310: Fix file size determination after save and move vlf-with-undo-disabled, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 290c4ac 176/310: Fix save with adjustment., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf d88080f 178/310: Don't apply VLF over ebrowse and TAGS databases., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 4d82c78 197/310: - don't nullify default buffer coding system, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 117935d 200/310: Add progress reporter when searching for difference., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf bfcbfd3 132/310: Make error message more descriptive., Stefan Monnier, 2020/11/28