diff options
| author | Michael Albinus | 2009-11-15 13:52:37 +0000 |
|---|---|---|
| committer | Michael Albinus | 2009-11-15 13:52:37 +0000 |
| commit | f5fce4ec56fc65663ec6a737efe2c5498052c76f (patch) | |
| tree | ee4493ffc47a3ff5c1747f87d2c52643c07973cc | |
| parent | f779e385544ed3b252796a76e1cabfc97a050014 (diff) | |
| download | emacs-f5fce4ec56fc65663ec6a737efe2c5498052c76f.tar.gz emacs-f5fce4ec56fc65663ec6a737efe2c5498052c76f.zip | |
* arc-mode.el (archive-maybe-copy): Move creation of directory ...
(archive-unique-fname): ... here. (Bug#4929)
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/arc-mode.el | 20 |
2 files changed, 16 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5ad24472e1c..e1a538d6b1e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-11-15 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * arc-mode.el (archive-maybe-copy): Move creation of directory ... | ||
| 4 | (archive-unique-fname): ... here. (Bug#4929) | ||
| 5 | |||
| 1 | 2009-11-15 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2009-11-15 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * help-mode.el (help-make-xrefs): Undo the last revert, and replace it | 8 | * help-mode.el (help-make-xrefs): Undo the last revert, and replace it |
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 3b7603b8c0e..62948c0cc3b 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el | |||
| @@ -818,15 +818,22 @@ If FNAME is something our underlying filesystem can't grok, or if another | |||
| 818 | file by that name already exists in DIR, a unique new name is generated | 818 | file by that name already exists in DIR, a unique new name is generated |
| 819 | using `make-temp-file', and the generated name is returned." | 819 | using `make-temp-file', and the generated name is returned." |
| 820 | (let ((fullname (expand-file-name fname dir)) | 820 | (let ((fullname (expand-file-name fname dir)) |
| 821 | (alien (string-match file-name-invalid-regexp fname))) | 821 | (alien (string-match file-name-invalid-regexp fname)) |
| 822 | (if (or alien (file-exists-p fullname)) | 822 | (tmpfile |
| 823 | (make-temp-file | ||
| 824 | (expand-file-name | 823 | (expand-file-name |
| 825 | (if (if (fboundp 'msdos-long-file-names) | 824 | (if (if (fboundp 'msdos-long-file-names) |
| 826 | (not (msdos-long-file-names))) | 825 | (not (msdos-long-file-names))) |
| 827 | "am" | 826 | "am" |
| 828 | "arc-mode.") | 827 | "arc-mode.") |
| 829 | dir)) | 828 | dir))) |
| 829 | (if (or alien (file-exists-p fullname)) | ||
| 830 | (progn | ||
| 831 | ;; Maked sure all the leading directories in | ||
| 832 | ;; archive-local-name exist under archive-tmpdir, so that | ||
| 833 | ;; the directory structure recorded in the archive is | ||
| 834 | ;; reconstructed in the temporary directory. | ||
| 835 | (make-directory (file-name-directory tmpfile) t) | ||
| 836 | (make-temp-file tmpfile)) | ||
| 830 | fullname))) | 837 | fullname))) |
| 831 | 838 | ||
| 832 | (defun archive-maybe-copy (archive) | 839 | (defun archive-maybe-copy (archive) |
| @@ -843,11 +850,6 @@ using `make-temp-file', and the generated name is returned." | |||
| 843 | archive))) | 850 | archive))) |
| 844 | (setq archive-local-name | 851 | (setq archive-local-name |
| 845 | (archive-unique-fname archive-name archive-tmpdir)) | 852 | (archive-unique-fname archive-name archive-tmpdir)) |
| 846 | ;; Maked sure all the leading directories in | ||
| 847 | ;; archive-local-name exist under archive-tmpdir, so that | ||
| 848 | ;; the directory structure recorded in the archive is | ||
| 849 | ;; reconstructed in the temporary directory. | ||
| 850 | (make-directory (file-name-directory archive-local-name) t) | ||
| 851 | (save-restriction | 853 | (save-restriction |
| 852 | (widen) | 854 | (widen) |
| 853 | (write-region start (point-max) archive-local-name nil 'nomessage)) | 855 | (write-region start (point-max) archive-local-name nil 'nomessage)) |