From aba78a68ef16b212a918f807a3363defc2c99f62 Mon Sep 17 00:00:00 2001 From: kaoru Date: Fri, 31 Jan 2003 08:22:26 +0000 Subject: [PATCH] * elmo-localdir.el (elmo-folder-rename-internal): Referctoring; Replace nested conditional with guard clauses. --- elmo/ChangeLog | 5 +++++ elmo/elmo-localdir.el | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) 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) -- 1.7.10.4