From 0d9cc8e488bc44845ccd3bc2f43fe2652f0f2101 Mon Sep 17 00:00:00 2001 From: Andrey Kotlarski Date: Thu, 4 Sep 2014 15:26:25 +0300 Subject: [PATCH] Don't measure encoding of too small region when adjusting chunk start and fix passing of elements to tune in vlf-occur. --- vlf-base.el | 6 ++++-- vlf-occur.el | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vlf-base.el b/vlf-base.el index 35bdd72..5b757c4 100644 --- a/vlf-base.el +++ b/vlf-base.el @@ -308,8 +308,10 @@ Return number of bytes moved back for proper decoding." (not (zerop safe-start))) (< shift 3) (let ((diff (- chunk-size - (vlf-tune-encode-length position - (point-max))))) + (length + (encode-coding-region + position (point-max) + buffer-file-coding-system t))))) (if strict (not (zerop diff)) (or (< diff -3) (< 0 diff))))) diff --git a/vlf-occur.el b/vlf-occur.el index 610f5b0..aebe299 100644 --- a/vlf-occur.el +++ b/vlf-occur.el @@ -202,7 +202,7 @@ Prematurely ending indexing will still show what's found so far." (time (float-time)) (tune-types (let ((base '(:insert :encode))) (if is-hexl - (nconc '(:hexl :dehexlify) base) + (append '(:hexl :dehexlify) base) base))) (reporter (make-progress-reporter (concat "Building index for " regexp "...")