diff lisp/tar-mode.el @ 14174:b986e1fb97a5

(tar-summarize-buffer): Speed-up for large files.
author Richard M. Stallman <rms@gnu.org>
date Mon, 15 Jan 1996 01:35:45 +0000
parents 83f275dcd93a
children f8eba77ccb7f
line wrap: on
line diff
--- a/lisp/tar-mode.el	Mon Jan 15 01:17:56 1996 +0000
+++ b/lisp/tar-mode.el	Mon Jan 15 01:35:45 1996 +0000
@@ -461,11 +461,16 @@
       (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)