cut visible folder when elmo-folder-delete returns non-nil value.
* elmo/elmo.el (elmo-folder-delete): Confirm deletion here, return t if
the folder has been deleted successfully.
* elmo/elmo-imap4.el (elmo-folder-delete): Ditto.
* elmo/elmo-archive.el (elmo-folder-delete): Ditto.
* elmo/elmo-localdir.el (elmo-folder-delete): Ditto.
* elmo/elmo-maildir.el (elmo-folder-delete): Ditto.
+2003-03-30 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * elmo.el (elmo-folder-delete): Confirm deletion here, return t if
+ the folder has been deleted successfully.
+ * elmo-imap4.el (elmo-folder-delete): Ditto.
+ * elmo-archive.el (elmo-folder-delete): Ditto.
+ * elmo-localdir.el (elmo-folder-delete): Ditto.
+ * elmo-maildir.el (elmo-folder-delete): Ditto.
+
2003-03-27 Tetsurou Okazaki <okazaki@be.to>
* elmo-util.el (elmo-string-member-ignore-case): New function.
(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)
(luna-define-method elmo-folder-writable-p ((folder elmo-imap4-folder))
t)
-(luna-define-method elmo-folder-delete :before ((folder elmo-imap4-folder))
- (let ((session (elmo-imap4-get-session folder))
- msgs)
- (when (elmo-imap4-folder-mailbox-internal folder)
- (when (setq msgs (elmo-folder-list-messages folder))
- (elmo-folder-delete-messages folder msgs))
- (elmo-imap4-send-command-wait session "close")
- (elmo-imap4-send-command-wait
- session
- (list "delete "
- (elmo-imap4-mailbox
- (elmo-imap4-folder-mailbox-internal folder)))))))
+(luna-define-method elmo-folder-delete ((folder elmo-imap4-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 ((session (elmo-imap4-get-session folder)))
+ (when (elmo-imap4-folder-mailbox-internal folder)
+ (when msgs (elmo-folder-delete-messages folder msgs))
+ (elmo-imap4-send-command-wait session "close")
+ (elmo-imap4-send-command-wait
+ session
+ (list "delete "
+ (elmo-imap4-mailbox
+ (elmo-imap4-folder-mailbox-internal folder))))))
+ (elmo-msgdb-delete-path folder)
+ t)))
(luna-define-method elmo-folder-rename-internal ((folder elmo-imap4-folder)
new-folder)
(elmo-make-directory dir))
t)))
-(luna-define-method elmo-folder-delete :before ((folder elmo-localdir-folder))
- (let ((dir (elmo-localdir-folder-directory-internal folder)))
- (if (not (file-directory-p dir))
- (error "No such directory: %s" dir)
- (elmo-delete-match-files dir "[0-9]+" t)
+(luna-define-method elmo-folder-delete ((folder elmo-localdir-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 ((dir (elmo-localdir-folder-directory-internal folder)))
+ (if (not (file-directory-p dir))
+ (error "No such directory: %s" dir)
+ (elmo-delete-match-files dir "[0-9]+" t)))
+ (elmo-msgdb-delete-path folder)
t)))
(luna-define-method elmo-folder-rename-internal ((folder elmo-localdir-folder)
t)
(error))))
-(luna-define-method elmo-folder-delete :before ((folder elmo-maildir-folder))
- (let ((basedir (elmo-maildir-folder-directory-internal folder)))
- (condition-case nil
- (let ((tmp-files (directory-files
- (expand-file-name "tmp" basedir)
- t "[^.].*")))
- ;; Delete files in tmp.
- (dolist (file tmp-files)
- (delete-file file))
- (dolist (dir '("new" "cur" "tmp" "."))
- (setq dir (expand-file-name dir basedir))
- (if (not (file-directory-p dir))
- (error nil)
- (elmo-delete-directory dir t)))
- t)
- (error nil))))
+(luna-define-method elmo-folder-delete ((folder elmo-maildir-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 ((basedir (elmo-maildir-folder-directory-internal folder)))
+ (condition-case nil
+ (let ((tmp-files (directory-files
+ (expand-file-name "tmp" basedir)
+ t "[^.].*")))
+ ;; Delete files in tmp.
+ (dolist (file tmp-files)
+ (delete-file file))
+ (dolist (dir '("new" "cur" "tmp" "."))
+ (setq dir (expand-file-name dir basedir))
+ (if (not (file-directory-p dir))
+ (error nil)
+ (elmo-delete-directory dir t))))
+ (error nil)))
+ (elmo-msgdb-delete-path folder)
+ t)))
(luna-define-method elmo-folder-rename-internal ((folder elmo-maildir-folder)
new-folder)
nil) ; default is not writable.
(luna-define-method elmo-folder-delete ((folder elmo-folder))
- (elmo-msgdb-delete-path folder))
+ (when (yes-or-no-p (format "Delete msgdb of \"%s\"? "
+ (elmo-folder-name-internal folder)))
+ (elmo-msgdb-delete-path folder)
+ t))
(luna-define-method elmo-folder-rename ((folder elmo-folder) new-name)
(let* ((new-folder (elmo-make-folder new-name)))
2003-03-30 Yoichi NAKAYAMA <yoichi@geiin.org>
+ * wl-fldmgr.el (wl-fldmgr-delete): Move confirmation to elmo side,
+ cut visible folder when elmo-folder-delete returns non-nil value.
+
+2003-03-30 Yoichi NAKAYAMA <yoichi@geiin.org>
+
* wl-draft.el (wl-draft-send-confirm): Display more info (advised
by Kenichi OKADA <okada@opaopa.org>).
(let* ((inhibit-read-only t)
(tmp (wl-fldmgr-get-path-from-buffer))
(entity (elmo-string (nth 4 tmp)))
- (folder (wl-folder-get-elmo-folder entity))
- (msgs (and (elmo-folder-exists-p folder)
- (elmo-folder-list-messages folder))))
- (when (yes-or-no-p (format "%sDo you really want to delete \"%s\"? "
- (if (> (length msgs) 0)
- (format "%d msg(s) exists. " (length msgs))
- "")
- entity))
- (elmo-folder-delete folder)
+ (folder (wl-folder-get-elmo-folder entity)))
+ (when (elmo-folder-delete folder)
(wl-fldmgr-cut tmp nil t)))))
(defun wl-fldmgr-rename ()