From: yoichi Date: Sun, 20 Aug 2006 15:30:32 +0000 (+0000) Subject: * elmo-archive.el (elmo-folder-append-messages): Delete temp-dir X-Git-Tag: wl-2_15_4~13 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd7535e376e2a4e67d31f1c3857e1bced2975701;p=elisp%2Fwanderlust.git * elmo-archive.el (elmo-folder-append-messages): Delete temp-dir even if some error occurred. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 4d4b96f..6ff3626 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,8 @@ 2006-08-20 Yoichi NAKAYAMA + * elmo-archive.el (elmo-folder-append-messages): Delete temp-dir + even if some error occurred. + * elmo-archive.el (elmo-archive-folder-append-buffer): Remove meaningless unwind-protect. diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index c9387dd..80b8e61 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -648,30 +648,32 @@ TYPE specifies the archiver's symbol." folder)) (car (elmo-folder-status folder)) 0))))) new-dir base-dir files) - (setq base-dir temp-dir) - (when (> (length prefix) 0) - (when (file-name-directory prefix) - (elmo-make-directory (file-name-directory prefix))) - (rename-file - temp-dir - (setq new-dir - (expand-file-name - prefix - ;; parent of temp-dir..(works in windows?) - (expand-file-name ".." temp-dir)))) - ;; now temp-dir has name prefix. - (setq temp-dir new-dir) - ;; parent of prefix becomes base-dir. - (setq base-dir (expand-file-name ".." temp-dir))) - (setq files - (mapcar - '(lambda (x) (elmo-concat-path prefix x)) - (directory-files temp-dir nil "^[^\\.]"))) - (if (elmo-archive-append-files folder - base-dir - files) - (elmo-delete-directory temp-dir) - (setq numbers nil))) + (unwind-protect + (progn + (setq base-dir temp-dir) + (when (> (length prefix) 0) + (when (file-name-directory prefix) + (elmo-make-directory (file-name-directory prefix))) + (rename-file + temp-dir + (setq new-dir + (expand-file-name + prefix + ;; parent of temp-dir..(works in windows?) + (expand-file-name ".." temp-dir)))) + ;; now temp-dir has name prefix. + (setq temp-dir new-dir) + ;; parent of prefix becomes base-dir. + (setq base-dir (expand-file-name ".." temp-dir))) + (setq files + (mapcar + '(lambda (x) (elmo-concat-path prefix x)) + (directory-files temp-dir nil "^[^\\.]"))) + (unless (elmo-archive-append-files folder + base-dir + files) + (setq numbers nil))) + (elmo-delete-directory temp-dir))) (elmo-progress-notify 'elmo-folder-move-messages (length numbers)) numbers) (t (luna-call-next-method)))))