From: yoichi Date: Wed, 15 Jan 2003 11:04:02 +0000 (+0000) Subject: * elmo-localdir.el (elmo-folder-rename-internal): If new-dir exist X-Git-Tag: merged-trunk-to-elmo-mark-14~23 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87f2c976ea97f43f78082f3db536a57c454bfdd5;p=elisp%2Fwanderlust.git * elmo-localdir.el (elmo-folder-rename-internal): If new-dir exist as non-directory, cause error before rename-file. * elmo-archive.el (elmo-folder-rename-internal): Create directory apropriately, mimic localdir's one. Based on the patch from KAMO Tomoyuki . --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 01ef5d5..7934065 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,11 @@ +2003-01-15 Yoichi NAKAYAMA + + * elmo-localdir.el (elmo-folder-rename-internal): If new-dir exist + as non-directory, cause error before rename-file. + * elmo-archive.el (elmo-folder-rename-internal): Create directory + apropriately, mimic localdir's one. + Based on the patch from KAMO Tomoyuki . + 2003-01-10 Tsutomu OKADA * elmo-map.el (elmo-folder-pack-numbers): Fix name of the function. diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index 341428b..40bfcf8 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -457,7 +457,11 @@ TYPE specifies the archiver's symbol." (luna-define-method elmo-folder-rename-internal ((folder elmo-archive-folder) new-folder) (let* ((old-arc (elmo-archive-get-archive-name folder)) - (new-arc (elmo-archive-get-archive-name new-folder))) + (new-arc (elmo-archive-get-archive-name new-folder)) + (new-dir (directory-file-name + (elmo-archive-get-archive-directory new-folder)))) + (if elmo-archive-treat-file + (setq new-dir (directory-file-name (file-name-directory new-dir)))) (unless (and (eq (elmo-archive-folder-archive-type-internal folder) (elmo-archive-folder-archive-type-internal new-folder)) (equal (elmo-archive-folder-archive-prefix-internal @@ -469,6 +473,8 @@ TYPE specifies the archiver's symbol." (error "No such file: %s" old-arc) (if (file-exists-p new-arc) (error "Already exists: %s" new-arc) + (if (not (file-directory-p new-dir)) + (elmo-make-directory new-dir)) (rename-file old-arc new-arc) t)))) diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 2fa24e5..1685988 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -311,7 +311,7 @@ (error "No such directory: %s" old) (if (file-exists-p new) (error "Already exists directory: %s" new) - (if (not (file-exists-p new-dir)) + (if (not (file-directory-p new-dir)) (elmo-make-directory new-dir)) (rename-file old new) t))))