-(luna-define-method elmo-folder-delete :before ((folder elmo-archive-folder))
- (let ((arc (elmo-archive-get-archive-name folder)))
- (if (not (file-exists-p arc))
- (error "No such file: %s" arc)
- (delete-file arc)
- t)))
+(luna-define-method elmo-folder-delete ((folder elmo-archive-folder))
+ (let ((msgs (and (elmo-folder-exists-p folder)
+ (elmo-folder-list-messages folder))))
+ (when (yes-or-no-p (format "%sDelete msgdb and substance of \"%s\"? "
+ (if (> (length msgs) 0)
+ (format "%d msg(s) exists. " (length msgs))
+ "")
+ (elmo-folder-name-internal folder)))
+ (let ((arc (elmo-archive-get-archive-name folder)))
+ (if (not (file-exists-p arc))
+ (error "No such file: %s" arc)
+ (delete-file arc))
+ (elmo-msgdb-delete-path folder)
+ t))))