From: kaoru Date: Thu, 30 Jan 2003 09:23:44 +0000 (+0000) Subject: * elmo-archive.el (elmo-folder-rename-internal): Referctoring; X-Git-Tag: wl-2_11_2~8 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b1d3abb16b5c77c63125b7a15317a92f785e0eab;p=elisp%2Fwanderlust.git * elmo-archive.el (elmo-folder-rename-internal): Referctoring; Replace nested conditional with guard clauses. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 28a8bbe..6fb540e 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2003-01-30 TAKAHASHI Kaoru + + * elmo-archive.el (elmo-folder-rename-internal): Referctoring; + Replace nested conditional with guard clauses. + 2003-01-30 Yuuichi Teranishi * pldap.el (ldap-search-basic): Don't treat exit status 32 as an diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index 40bfcf8..62dc48a 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -469,14 +469,14 @@ TYPE specifies the archiver's symbol." (elmo-archive-folder-archive-prefix-internal new-folder))) (error "Not same archive type and prefix")) - (if (not (file-exists-p old-arc)) - (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)))) + (unless (file-exists-p old-arc) + (error "No such file: %s" old-arc)) + (when (file-exists-p new-arc) + (error "Already exists: %s" new-arc)) + (unless (file-directory-p new-dir) + (elmo-make-directory new-dir)) + (rename-file old-arc new-arc) + t)) (defun elmo-archive-folder-list-subfolders (folder one-level) (if elmo-archive-treat-file