aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2004-10-08 17:31:51 +0000
committerEli Zaretskii2004-10-08 17:31:51 +0000
commitd0e2accefacb2323db4cf893c425356e8915d4f0 (patch)
treecff20843441428a85fc280294fe5ab07667272d2
parentb4329caaf870b78b09bfbbc0b5e79f3b3296b230 (diff)
downloademacs-d0e2accefacb2323db4cf893c425356e8915d4f0.tar.gz
emacs-d0e2accefacb2323db4cf893c425356e8915d4f0.zip
(tar-summarize-buffer): Use progress reporter.
-rw-r--r--lisp/tar-mode.el13
1 files changed, 5 insertions, 8 deletions
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 0f0c22cabe1..62686d026c1 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -404,11 +404,11 @@ Place a dired-like listing on the front;
404then narrow to it, so that only that listing 404then narrow to it, so that only that listing
405is visible (and the real data of the buffer is hidden)." 405is visible (and the real data of the buffer is hidden)."
406 (set-buffer-multibyte nil) 406 (set-buffer-multibyte nil)
407 (message "Parsing tar file...")
408 (let* ((result '()) 407 (let* ((result '())
409 (pos (point-min)) 408 (pos (point-min))
410 (bs (max 1 (- (buffer-size) 1024))) ; always 2+ empty blocks at end. 409 (progress-reporter
411 (bs100 (max 1 (/ bs 100))) 410 (make-progress-reporter "Parsing tar file..."
411 (point-min) (max 1 (- (buffer-size) 1024))))
412 tokens) 412 tokens)
413 (while (and (<= (+ pos 512) (point-max)) 413 (while (and (<= (+ pos 512) (point-max))
414 (not (eq 'empty-tar-block 414 (not (eq 'empty-tar-block
@@ -416,10 +416,7 @@ is visible (and the real data of the buffer is hidden)."
416 (tar-header-block-tokenize 416 (tar-header-block-tokenize
417 (buffer-substring pos (+ pos 512))))))) 417 (buffer-substring pos (+ pos 512)))))))
418 (setq pos (+ pos 512)) 418 (setq pos (+ pos 512))
419 (message "Parsing tar file...%d%%" 419 (progress-reporter-update progress-reporter pos)
420 ;(/ (* pos 100) bs) ; this gets round-off lossage
421 (/ pos bs100) ; this doesn't
422 )
423 (if (eq (tar-header-link-type tokens) 20) 420 (if (eq (tar-header-link-type tokens) 20)
424 ;; Foo. There's an extra empty block after these. 421 ;; Foo. There's an extra empty block after these.
425 (setq pos (+ pos 512))) 422 (setq pos (+ pos 512)))
@@ -446,7 +443,7 @@ is visible (and the real data of the buffer is hidden)."
446 ;; A tar file should end with a block or two of nulls, 443 ;; A tar file should end with a block or two of nulls,
447 ;; but let's not get a fatal error if it doesn't. 444 ;; but let's not get a fatal error if it doesn't.
448 (if (eq tokens 'empty-tar-block) 445 (if (eq tokens 'empty-tar-block)
449 (message "Parsing tar file...done") 446 (progress-reporter-done progress-reporter)
450 (message "Warning: premature EOF parsing tar file"))) 447 (message "Warning: premature EOF parsing tar file")))
451 (save-excursion 448 (save-excursion
452 (goto-char (point-min)) 449 (goto-char (point-min))