From b1d3abb16b5c77c63125b7a15317a92f785e0eab Mon Sep 17 00:00:00 2001 From: kaoru Date: Thu, 30 Jan 2003 09:23:44 +0000 Subject: [PATCH] * elmo-archive.el (elmo-folder-rename-internal): Referctoring; Replace nested conditional with guard clauses. --- elmo/ChangeLog | 5 +++++ elmo/elmo-archive.el | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) 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 -- 1.7.10.4