1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 02:51:31 -08:00

(rmail-confirm-expunge): New user-option.

(rmail-expunge): Ask for confirmation depending on the setting
of rmail-confirm-expunge.
This commit is contained in:
Gerd Moellmann 2000-03-24 12:12:58 +00:00
parent 02c76af416
commit 9f7c6da9c5

View file

@ -218,6 +218,15 @@ and the value of the environment variable MAIL overrides it)."
:type 'regexp
: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 ***