* elmo-localdir.el (elmo-folder-rename-internal): Referctoring;
authorkaoru <kaoru>
Fri, 31 Jan 2003 08:22:26 +0000 (08:22 +0000)
committerkaoru <kaoru>
Fri, 31 Jan 2003 08:22:26 +0000 (08:22 +0000)
Replace nested conditional with guard clauses.

elmo/ChangeLog
elmo/elmo-localdir.el

index 6fb540e..0ecb0cf 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-31  TAKAHASHI Kaoru  <kaoru@kaisei.org>
+
+       * elmo-localdir.el (elmo-folder-rename-internal): Referctoring;
+       Replace nested conditional with guard clauses.
+
 2003-01-30  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * elmo-archive.el (elmo-folder-rename-internal): Referctoring;
index 3f3c8d4..3ab93a0 100644 (file)
   (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)