From 7978f2cac4a7e1d72063788523c1688bd5b43cd7 Mon Sep 17 00:00:00 2001 From: Vitaly Mayatskikh Date: Fri, 24 Oct 2008 18:30:26 +0200 Subject: [PATCH] wl-expire-folder was splitted to 2 parts (added new function wl-expireable-messages-list). Ask second confirmation with amount of messages to expire. --- wl/wl-expire.el | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/wl/wl-expire.el b/wl/wl-expire.el index bd3b418..3a68d8d 100644 --- a/wl/wl-expire.el +++ b/wl/wl-expire.el @@ -592,7 +592,14 @@ ex. +ml/wl/1999_11/, +ml/wl/1999_12/." (y-or-n-p (format "Expire %s? " folder-name))) (save-excursion (run-hooks 'wl-summary-expire-pre-hook) - (let ((expired (apply #'wl-expire-folder folder all rule))) + (let* ((expireable (apply #'wl-expireable-messages-list folder + all rule)) + (expired (and expireable + (or (not (interactive-p)) + (y-or-n-p (format "Expire %d messages?" + (length expireable)))) + (apply #'wl-expire-folder folder + expireable rule)))) (when (and (not wl-expire-test) (not notsummary) expired) @@ -608,9 +615,8 @@ ex. +ml/wl/1999_11/, +ml/wl/1999_12/." (message "No expire"))) expired)))))) -(defun wl-expire-folder (folder all condition action &rest args) - (let ((folder-name (elmo-folder-name-internal folder)) - (val-type (car condition)) +(defun wl-expireable-messages-list (folder all condition action &rest args) + (let ((val-type (car condition)) (value (nth 1 condition)) targets) (cond @@ -643,6 +649,10 @@ ex. +ml/wl/1999_11/, +ml/wl/1999_12/." (list (elmo-message-entity-number entity))))))) (t (error "%s: not supported" val-type))) + targets)) + +(defun wl-expire-folder (folder targets condition action &rest args) + (let ((folder-name (elmo-folder-name-internal folder))) (when targets (or wl-expired-alist (setq wl-expired-alist (wl-expired-alist-load))) -- 2.11.4.GIT