From e8421604cdd386af0c32fb7cf698882ec6b74015 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 7 Aug 2001 13:36:14 +0000 Subject: [PATCH] (tar-extract): Avoid generating a new buffer for each file visited. From Markus Rost . --- lisp/ChangeLog | 5 ++++- lisp/tar-mode.el | 18 +++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0514c8b190b..2cb05fc7fba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2001-08-07 Gerd Moellmann + * tar-mode.el (tar-extract): Avoid generating a new buffer + for each file visited. From Markus Rost . + * textmodes/paragraphs.el (forward-sentence): Avoid building a regexp from sentence-end. From Kenichi Handa . @@ -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. diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index 86e05ac269e..2e1b8c5d5de 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -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) -- 2.39.2