From: Gerd Moellmann Date: Mon, 4 Dec 2000 16:40:57 +0000 (+0000) Subject: (rmail-expunge-confirmed): New function. X-Git-Tag: emacs-pretest-21.0.93~235 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e6be618b872728aea53924adf3470b30cd1f0af8;p=emacs.git (rmail-expunge-confirmed): New function. (rmail-expunge): Use it. --- diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 70506ef5ad1..dfe32731794 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -2665,6 +2665,15 @@ Deleted messages stay in the file until the \\[rmail-expunge] command is given." (setq i (1+ i))) newnum))) +(defun rmail-expunge-confirmed () + "Return t if deleted message should be expunged. If necessary, ask the user. +See also user-option `rmail-confirm-expunge'." + (or (not (stringp rmail-deleted-vector)) + (not (string-match "D" rmail-deleted-vector)) + (null rmail-confirm-expunge) + (funcall rmail-confirm-expunge + "Erase deleted messages from Rmail file? "))) + (defun rmail-only-expunge () "Actually erase all deleted messages in the file." (interactive) @@ -2747,15 +2756,10 @@ Deleted messages stay in the file until the \\[rmail-expunge] command is given." (defun rmail-expunge () "Erase deleted messages from Rmail file and summary buffer." (interactive) - (when (and (stringp rmail-deleted-vector) - (string-match "D" rmail-deleted-vector) - (or (null rmail-confirm-expunge) - (funcall rmail-confirm-expunge - "Erase deleted messages from Rmail file? "))) + (when (rmail-expunge-confirmed) (rmail-only-expunge) (if (rmail-summary-exists) - (rmail-select-summary - (rmail-update-summary))))) + (rmail-select-summary (rmail-update-summary))))) ;;;; *** Rmail Mailing Commands ***