+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;
(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)