Mercurial > emacs
changeset 38719:03376ff9ccfd
(tar-extract): Avoid generating a new buffer
for each file visited. From Markus Rost <rost@math.ohio-state.edu>.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 07 Aug 2001 13:35:23 +0000 |
parents | 413ba1a72a24 |
children | d2144cf72859 |
files | lisp/tar-mode.el |
diffstat | 1 files changed, 7 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/tar-mode.el Tue Aug 07 11:37:10 2001 +0000 +++ b/lisp/tar-mode.el Tue Aug 07 13:35:23 2001 +0000 @@ -682,21 +682,17 @@ (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)