]> git.eshelyaron.com Git - emacs.git/commitdiff
(tar-extract): Avoid generating a new buffer
authorGerd Moellmann <gerd@gnu.org>
Tue, 7 Aug 2001 13:36:14 +0000 (13:36 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 7 Aug 2001 13:36:14 +0000 (13:36 +0000)
for each file visited.  From Markus Rost <rost@math.ohio-state.edu>.

lisp/ChangeLog
lisp/tar-mode.el

index 0514c8b190b294bb2957b8fbf93d896f7206492f..2cb05fc7fba936f392bd9c89e12996881c7f3aa9 100644 (file)
@@ -1,5 +1,8 @@
 2001-08-07  Gerd Moellmann  <gerd@gnu.org>
 
+       * tar-mode.el (tar-extract): Avoid generating a new buffer
+       for each file visited.  From Markus Rost <rost@math.ohio-state.edu>.
+
        * textmodes/paragraphs.el (forward-sentence): Avoid building
        a regexp from sentence-end.  From Kenichi Handa <handa@etl.go.jp>.
 
@@ -8,7 +11,7 @@
        inserting it.
 
        * image.el (image-type-regexps): For JPEG files, use a regexp
-       derived from the JPEG spec.
+       derived from the JFIF spec.
        
        * image.el (image-type-regexps): Use `\`' instead of `^' in
        most regular expressions.
index 86e05ac269ee141c42cb29ca2399adb3057220e5..2e1b8c5d5deb8fbdcf3540baaa835911ea95f81e 100644 (file)
@@ -682,21 +682,17 @@ appear on disk when you save the tar-file's buffer."
     (let* ((tar-buffer (current-buffer))
           (tar-buffer-multibyte enable-multibyte-characters)
           (tarname (buffer-name))
-          (bufname (generate-new-buffer-name
-                    (concat (file-name-nondirectory name)
-                            " ("
+          (bufname (concat (file-name-nondirectory name)
+                           " ("
                             tarname
-                            ")")))
+                            ")"))
           (read-only-p (or buffer-read-only view-p))
-          (buffer (get-buffer bufname))
-          (just-created nil)
           (new-buffer-file-name (expand-file-name
                                  ;; `:' is not allowed on Windows
-                                 (concat tarname "!" name))))
-      (if (and buffer
-              ;; Check that the buffer is visiting the same file
-              (equal (buffer-file-name buffer) new-buffer-file-name))
-         nil
+                                 (concat tarname "!" name)))
+          (buffer (get-file-buffer new-buffer-file-name))
+          (just-created nil))
+      (unless buffer
        (setq buffer (generate-new-buffer bufname))
        (setq bufname (buffer-name buffer))
        (setq just-created t)