* elmo.el (elmo-generic-folder-append-messages): Set flag as nil
[elisp/wanderlust.git] / elmo / elmo-archive.el
index eb94d29..2fb1c3c 100644 (file)
@@ -447,12 +447,20 @@ TYPE specifies the archiver's symbol."
             (delete-file dummy)))
        ))))
 
-(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))))
 
 (luna-define-method elmo-folder-rename-internal ((folder elmo-archive-folder)
                                                 new-folder)