diff lisp/mail/rmail.el @ 34185:f43d562a5b65

(rmail-expunge-confirmed): New function. (rmail-expunge): Use it.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 04 Dec 2000 16:40:57 +0000
parents 331be7a21155
children a06f22cd075b
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Mon Dec 04 16:40:31 2000 +0000
+++ b/lisp/mail/rmail.el	Mon Dec 04 16:40:57 2000 +0000
@@ -2665,6 +2665,15 @@
 	(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 @@
 (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 ***