From: kaoru Date: Fri, 31 Jan 2003 08:22:26 +0000 (+0000) Subject: * elmo-localdir.el (elmo-folder-rename-internal): Referctoring; X-Git-Tag: wl-2_11_2~7 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=aba78a68ef16b212a918f807a3363defc2c99f62;p=elisp%2Fwanderlust.git * elmo-localdir.el (elmo-folder-rename-internal): Referctoring; Replace nested conditional with guard clauses. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 6fb540e..0ecb0cf 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2003-01-31 TAKAHASHI Kaoru + + * elmo-localdir.el (elmo-folder-rename-internal): Referctoring; + Replace nested conditional with guard clauses. + 2003-01-30 TAKAHASHI Kaoru * elmo-archive.el (elmo-folder-rename-internal): Referctoring; diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 3f3c8d4..3ab93a0 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -311,14 +311,14 @@ (let* ((old (elmo-localdir-folder-directory-internal folder)) (new (elmo-localdir-folder-directory-internal new-folder)) (new-dir (directory-file-name (file-name-directory new)))) - (if (not (file-directory-p old)) - (error "No such directory: %s" old) - (if (file-exists-p new) - (error "Already exists directory: %s" new) - (if (not (file-directory-p new-dir)) - (elmo-make-directory new-dir)) - (rename-file old new) - t)))) + (unless (file-directory-p old) + (error "No such directory: %s" old)) + (when (file-exists-p new) + (error "Already exists directory: %s" new)) + (unless (file-directory-p new-dir) + (elmo-make-directory new-dir)) + (rename-file old new) + t)) (defsubst elmo-localdir-field-condition-match (folder condition number number-list)