summaryrefslogtreecommitdiff
path: root/lisp/mail/rmail.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-03-24 12:12:58 +0000
committerGerd Moellmann <gerd@gnu.org>2000-03-24 12:12:58 +0000
commit9f7c6da9c5bfd16c1b52a25c39731edb13fecf6c (patch)
tree639cc5f480fe52f2eef48103dcdc22f2fc5b8b0b /lisp/mail/rmail.el
parent02c76af4163f44214a0894cb1c7995adac39261d (diff)
downloademacs-9f7c6da9c5bfd16c1b52a25c39731edb13fecf6c.tar.gz
emacs-9f7c6da9c5bfd16c1b52a25c39731edb13fecf6c.tar.bz2
emacs-9f7c6da9c5bfd16c1b52a25c39731edb13fecf6c.zip
(rmail-confirm-expunge): New user-option.
(rmail-expunge): Ask for confirmation depending on the setting of rmail-confirm-expunge.
Diffstat (limited to 'lisp/mail/rmail.el')
-rw-r--r--lisp/mail/rmail.el20
1 files changed, 16 insertions, 4 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 1586f37b000..1aab4a4b4b2 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -219,6 +219,15 @@ and the value of the environment variable MAIL overrides it)."
:group 'rmail-files)
;;;###autoload
+(defcustom rmail-confirm-expunge 'yes-or-no-p
+ "*Whether and how to ask for confirmation before expunging deleted messages."
+ :type '(choice (const :tag "No confirmation" nil)
+ (const :tag "Confirm with y-or-n-p" y-or-n-p)
+ (const :tag "Confirm with yes-or-no-p" yes-or-no-p))
+ :version "21.1"
+ :group 'rmail-files)
+
+;;;###autoload
(defvar rmail-mode-hook nil
"List of functions to call when Rmail is invoked.")
@@ -2674,10 +2683,13 @@ 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)
- (rmail-only-expunge)
- (if (rmail-summary-exists)
- (rmail-select-summary
- (rmail-update-summary))))
+ (when (or (null rmail-confirm-expunge)
+ (funcall rmail-confirm-expunge
+ "Erase deleted messages from Rmail file? "))
+ (rmail-only-expunge)
+ (if (rmail-summary-exists)
+ (rmail-select-summary
+ (rmail-update-summary)))))
;;;; *** Rmail Mailing Commands ***