From e3be8d5d98970d1cfab8f91e1a7c67919d53b4df Mon Sep 17 00:00:00 2001 From: Andrey Kotlarski Date: Mon, 15 Apr 2013 15:04:22 +0300 Subject: [PATCH] Don't adjust chunk with more that 3 bytes and inhibit spurious update messages when saving content with changes size. --- vlfi.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vlfi.el b/vlfi.el index 964e147..e6c05d1 100644 --- a/vlfi.el +++ b/vlfi.el @@ -345,6 +345,7 @@ When given MINIMAL flag, skip non important operations." Return number of bytes moved back for this to happen." (let ((shift 0)) (while (and (not (zerop vlfi-start-pos)) + (< shift 3) (/= (- vlfi-end-pos vlfi-start-pos) (length (encode-coding-region (point-min) (point-max) @@ -595,7 +596,7 @@ back at WRITE-POS. Return nil if EOF is reached, t otherwise." (insert-file-contents-literally buffer-file-name nil read-pos (min vlfi-file-size read-end)) - (write-region nil nil buffer-file-name write-pos t) + (write-region nil nil buffer-file-name write-pos 0) (< read-end vlfi-file-size))) (defun vlfi-file-shift-forward (size-change) @@ -648,7 +649,7 @@ Return nil if EOF is reached, t otherwise." size)))) ;; write (set-buffer write-buffer) - (write-region nil nil buffer-file-name write-pos t) + (write-region nil nil buffer-file-name write-pos 0) read-more)) (provide 'vlfi)