X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/2d44e7fef7e7388759518cba1a424495119679d1..fa30e182cb9621e109df0525f9abafc7f6bc6028:/packages/vlf/vlf-ediff.el diff --git a/packages/vlf/vlf-ediff.el b/packages/vlf/vlf-ediff.el index 2b7c63f54..e168cf969 100644 --- a/packages/vlf/vlf-ediff.el +++ b/packages/vlf/vlf-ediff.el @@ -34,7 +34,8 @@ "If non nil, specifies that ediff is done over VLF buffers.") (make-variable-buffer-local 'vlf-ediff-session) -;;;###autoload +(defvar tramp-verbose) + (defun vlf-ediff-buffers (buffer-A buffer-B) "Run batch by batch ediff over VLF buffers BUFFER-A and BUFFER-B. Batch size is determined by the size in BUFFER-A. @@ -93,10 +94,10 @@ respectively of difference list, runs ediff over the adjacent chunks." dir-B))) (ediff-get-default-file-name f 1))) (read-number "Batch size (in bytes): " vlf-batch-size)))) - (let ((buffer-A (vlf file-A))) + (let ((buffer-A (vlf file-A t))) (set-buffer buffer-A) (vlf-set-batch-size batch-size) - (let ((buffer-B (vlf file-B))) + (let ((buffer-B (vlf file-B t))) (vlf-ediff-buffers buffer-A buffer-B)))) (defadvice ediff-next-difference (around vlf-ediff-next-difference @@ -142,11 +143,11 @@ beginning of difference list." (defun vlf-next-chunk () "Move to next chunk." - (vlf-move-to-chunk vlf-end-pos (+ vlf-end-pos vlf-batch-size) t)) + (vlf-move-to-chunk vlf-end-pos (+ vlf-end-pos vlf-batch-size))) (defun vlf-prev-chunk () "Move to previous chunk." - (vlf-move-to-chunk (- vlf-start-pos vlf-batch-size) vlf-start-pos t)) + (vlf-move-to-chunk (- vlf-start-pos vlf-batch-size) vlf-start-pos)) (defun vlf-ediff-next (buffer-A buffer-B ediff-buffer &optional next-func) @@ -161,14 +162,16 @@ logical chunks in case there is no difference at the current ones." (point-max-A (point-max)) (font-lock-A font-lock-mode) (min-file-size vlf-file-size) - (forward-p (eq next-func 'vlf-next-chunk))) + (forward-p (eq next-func 'vlf-next-chunk)) + (is-hexl (derived-mode-p 'hexl-mode))) (font-lock-mode 0) (set-buffer buffer-B) (run-hook-with-args 'vlf-before-batch-functions 'ediff) (setq buffer-B (current-buffer) - min-file-size (min min-file-size vlf-file-size)) + min-file-size (min min-file-size vlf-file-size) + is-hexl (or is-hexl (derived-mode-p 'hexl-mode))) (let ((tramp-verbose (if (boundp 'tramp-verbose) - (min tramp-verbose 2))) + (min tramp-verbose 1))) (end-B (= vlf-start-pos vlf-end-pos)) (chunk-B (cons vlf-start-pos vlf-end-pos)) (font-lock-B font-lock-mode) @@ -187,7 +190,7 @@ logical chunks in case there is no difference at the current ones." buffer-B (point-min) (point-max))) (with-current-buffer ediff-buffer (ediff-update-diffs) - (and (not end-A) (not end-B) + (and (not end-A) (not end-B) (not is-hexl) (vlf-ediff-refine buffer-A buffer-B)) (zerop ediff-number-of-differences)))) @@ -202,10 +205,7 @@ logical chunks in case there is no difference at the current ones." (- vlf-file-size vlf-start-pos)))) (progress-reporter-done reporter) - (if (or (not end-A) (not end-B)) - (progn (vlf-update-buffer-name) - (set-buffer buffer-A) - (vlf-update-buffer-name)) + (when (and end-A end-B) (if forward-p (let ((max-file-size vlf-file-size)) (vlf-move-to-chunk (- max-file-size vlf-batch-size) @@ -216,14 +216,15 @@ logical chunks in case there is no difference at the current ones." (vlf-move-to-chunk (- max-file-size vlf-batch-size) max-file-size)) - (vlf-beginning-of-file) + (vlf-move-to-batch 0) (set-buffer buffer-A) - (vlf-beginning-of-file)) + (vlf-move-to-batch 0)) (set-buffer ediff-buffer) (ediff-update-diffs) - (if (or (not forward-p) - (and (not end-A) (not end-B))) - (vlf-ediff-refine buffer-A buffer-B))) + (or is-hexl + (if (or (not forward-p) + (and (not end-A) (not end-B))) + (vlf-ediff-refine buffer-A buffer-B)))) (setq done t)) (unless done (set-buffer buffer-A) @@ -234,7 +235,8 @@ logical chunks in case there is no difference at the current ones." (vlf-move-to-chunk (car chunk-B) (cdr chunk-B)) (set-buffer ediff-buffer) (ediff-update-diffs) - (vlf-ediff-refine buffer-A buffer-B)) + (or is-hexl + (vlf-ediff-refine buffer-A buffer-B))) (set-buffer buffer-A) (if font-lock-A (font-lock-mode 1)) (run-hook-with-args 'vlf-after-batch-functions 'ediff)