]> git.eshelyaron.com Git - emacs.git/commitdiff
* arc-mode.el (archive-maybe-copy): Move creation of directory ...
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 15 Nov 2009 13:52:37 +0000 (13:52 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 15 Nov 2009 13:52:37 +0000 (13:52 +0000)
(archive-unique-fname): ... here.  (Bug#4929)

lisp/ChangeLog
lisp/arc-mode.el

index 5ad24472e1cb7a94925335ea095a6cc9aece0155..e1a538d6b1eb43c40b266932904ca9146d84e639 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-15  Michael Albinus  <michael.albinus@gmx.de>
+
+       * arc-mode.el (archive-maybe-copy): Move creation of directory ...
+       (archive-unique-fname): ... here.  (Bug#4929)
+
 2009-11-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * help-mode.el (help-make-xrefs): Undo the last revert, and replace it
index 3b7603b8c0ef1e6a3c47301c10b85db88cfbdea3..62948c0cc3b807dfb85eb6800ed3d32010a73ea5 100644 (file)
@@ -818,15 +818,22 @@ If FNAME is something our underlying filesystem can't grok, or if another
 file by that name already exists in DIR, a unique new name is generated
 using `make-temp-file', and the generated name is returned."
   (let ((fullname (expand-file-name fname dir))
-       (alien (string-match file-name-invalid-regexp fname)))
-    (if (or alien (file-exists-p fullname))
-       (make-temp-file
+       (alien (string-match file-name-invalid-regexp fname))
+       (tmpfile
         (expand-file-name
          (if (if (fboundp 'msdos-long-file-names)
                  (not (msdos-long-file-names)))
              "am"
            "arc-mode.")
-         dir))
+         dir)))
+    (if (or alien (file-exists-p fullname))
+       (progn
+         ;; Maked sure all the leading directories in
+         ;; archive-local-name exist under archive-tmpdir, so that
+         ;; the directory structure recorded in the archive is
+         ;; reconstructed in the temporary directory.
+         (make-directory (file-name-directory tmpfile) t)
+         (make-temp-file tmpfile))
       fullname)))
 
 (defun archive-maybe-copy (archive)
@@ -843,11 +850,6 @@ using `make-temp-file', and the generated name is returned."
                   archive)))
          (setq archive-local-name
                (archive-unique-fname archive-name archive-tmpdir))
-         ;; Maked sure all the leading directories in
-         ;; archive-local-name exist under archive-tmpdir, so that
-         ;; the directory structure recorded in the archive is
-         ;; reconstructed in the temporary directory.
-         (make-directory (file-name-directory archive-local-name) t)
          (save-restriction
            (widen)
            (write-region start (point-max) archive-local-name nil 'nomessage))