changeset 69331:619b0c2000a6

* arc-mode.el (archive-extract): Check if an existing buffer name comes from a different archive.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 08 Mar 2006 01:57:59 +0000
parents b000598ecc11
children e1685cc1a657
files lisp/ChangeLog lisp/arc-mode.el
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Mar 07 23:28:33 2006 +0000
+++ b/lisp/ChangeLog	Wed Mar 08 01:57:59 2006 +0000
@@ -1,5 +1,8 @@
 2006-03-07  Chong Yidong  <cyd@stupidchicken.com>
 
+	* arc-mode.el (archive-extract): Check if an existing buffer name
+	comes from a different archive.
+
 	* help.el (describe-key-briefly): If KEY is a down event, read and
 	discard the up event.
 
--- a/lisp/arc-mode.el	Tue Mar 07 23:28:33 2006 +0000
+++ b/lisp/arc-mode.el	Wed Mar 08 01:57:59 2006 +0000
@@ -907,16 +907,18 @@
          (read-only-p (or archive-read-only
 			  view-p
 			  (string-match file-name-invalid-regexp ename)))
+	 (arcfilename (expand-file-name (concat arcname ":" iname)))
          (buffer (get-buffer bufname))
          (just-created nil))
-      (if buffer
+      (if (and buffer
+	       (string= (buffer-file-name buffer) arcfilename))
           nil
 	(setq archive (archive-maybe-copy archive))
+	(setq bufname (generate-new-buffer-name bufname))
         (setq buffer (get-buffer-create bufname))
         (setq just-created t)
         (with-current-buffer buffer
-          (setq buffer-file-name
-                (expand-file-name (concat arcname ":" iname)))
+          (setq buffer-file-name arcfilename)
           (setq buffer-file-truename
                 (abbreviate-file-name buffer-file-name))
           ;; Set the default-directory to the dir of the superior buffer.