summaryrefslogtreecommitdiff
path: root/lisp/tar-mode.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-01-15 01:35:45 +0000
committerRichard M. Stallman <rms@gnu.org>1996-01-15 01:35:45 +0000
commit074c328d844ac32160412f92b2421b268269ef6b (patch)
tree618a6573f9d7e33675e5dd2ca460597b8d214e78 /lisp/tar-mode.el
parenta2e9c527d0356bfa8a68ea68fd56ea992a730c07 (diff)
downloademacs-074c328d844ac32160412f92b2421b268269ef6b.tar.gz
(tar-summarize-buffer): Speed-up for large files.
Diffstat (limited to 'lisp/tar-mode.el')
-rw-r--r--lisp/tar-mode.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 28a31f504ec..311212de14f 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -461,11 +461,16 @@ is visible (and the real data of the buffer is hidden)."
(message "Warning: premature EOF parsing tar file")))
(save-excursion
(goto-char (point-min))
- (let ((buffer-read-only nil))
+ (let ((buffer-read-only nil)
+ (summaries nil))
+ ;; Collect summary lines and insert them all at once since tar files
+ ;; can be pretty big.
(tar-dolist (tar-desc tar-parse-info)
- (insert-string
- (tar-header-block-summarize (tar-desc-tokens tar-desc)))
- (insert-string "\n"))
+ (setq summaries
+ (cons (tar-header-block-summarize (tar-desc-tokens tar-desc))
+ (cons "\n"
+ summaries))))
+ (insert (apply 'concat summaries))
(make-local-variable 'tar-header-offset)
(setq tar-header-offset (point))
(narrow-to-region 1 tar-header-offset)