From: okada Date: Thu, 31 Jan 2002 22:03:24 +0000 (+0000) Subject: * wl-summary.el (wl-summary-pick): Fix for killed messages. X-Git-Tag: wl-2_9_7~19 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d790fd65708c5192011a3302e3af808d4c7d819c;p=elisp%2Fwanderlust.git * wl-summary.el (wl-summary-pick): Fix for killed messages. (wl-summary-target-mark-msgs): Return the number of marked messages. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index ca333d5..5e395cd 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2002-02-01 Kenichi OKADA + + * wl-summary.el (wl-summary-pick): Fix for killed messages. + (wl-summary-target-mark-msgs): Return the number of marked messages. + 2002-01-26 ARISAWA Akihiro * wl-summary.el (wl-summary-sync): Fixed problem when "last:" or diff --git a/wl/wl-summary.el b/wl/wl-summary.el index b79ad6f..53cb147 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -3678,33 +3678,44 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." (wl-summary-target-mark-region beg end))) (defun wl-summary-target-mark-msgs (msgs) - (while msgs - (if (eq wl-summary-buffer-view 'thread) - (wl-thread-jump-to-msg (car msgs)) - (wl-summary-jump-to-msg (car msgs))) - (wl-summary-target-mark (wl-summary-message-number)) - (setq msgs (cdr msgs)))) + "Return the number of marked messages." + (let ((i 0) num) + (while msgs + (if (eq wl-summary-buffer-view 'thread) + (wl-thread-jump-to-msg (car msgs)) + (wl-summary-jump-to-msg (car msgs))) + (setq num (wl-summary-message-number)) + (when (eq num (car msgs)) + (wl-summary-target-mark num) + (setq i (1+ i))) + (setq msgs (cdr msgs))) + i)) (defun wl-summary-pick (&optional from-list delete-marks) (interactive) - (let* ((condition (car (elmo-parse-search-condition - (elmo-read-search-condition - wl-summary-pick-field-default)))) - (result (elmo-folder-search wl-summary-buffer-elmo-folder - condition - from-list))) - (if delete-marks - (let ((mlist wl-summary-buffer-target-mark-list)) - (while mlist - (when (wl-summary-jump-to-msg (car mlist)) - (wl-summary-unmark)) - (setq mlist (cdr mlist))) - (setq wl-summary-buffer-target-mark-list nil))) - (if result - (progn - (wl-summary-target-mark-msgs result) - (message "%d message(s) are picked." (length result))) - (message "No message was picked.")))) + (save-excursion + (let* ((condition (car (elmo-parse-search-condition + (elmo-read-search-condition + wl-summary-pick-field-default)))) + (result (elmo-folder-search wl-summary-buffer-elmo-folder + condition + from-list)) + num) + (if delete-marks + (let ((mlist wl-summary-buffer-target-mark-list)) + (while mlist + (when (wl-summary-jump-to-msg (car mlist)) + (wl-summary-unmark)) + (setq mlist (cdr mlist))) + (setq wl-summary-buffer-target-mark-list nil))) + (if result + (setq num (wl-summary-target-mark-msgs result))) + (if (> num 0) + (if (= num (length result)) + (message "%d message(s) are picked." num) + (message "%d(%d) message(s) are picked." num + (- (length result) num))) + (message "No message was picked."))))) (defun wl-summary-unvirtual () "Exit from current virtual folder."