X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=wl%2Fwl-action.el;h=9c073688468b6f7336e8e0bb8360562f94fd424f;hb=40ada79e654909e3b4061f1b7c59c447d00dd1d9;hp=f4007dac4fc2953348bc523cc216ceadab221956;hpb=3b99395034f8773fde1d868427be59d728d60344;p=elisp%2Fwanderlust.git diff --git a/wl/wl-action.el b/wl/wl-action.el index f4007da..9c07368 100644 --- a/wl/wl-action.el +++ b/wl/wl-action.el @@ -434,19 +434,10 @@ Return number if put mark succeed" ;; Refile action (defun wl-summary-set-action-refile (number mark data) - (let ((policy (wl-get-assoc-list-value wl-refile-policy-alist - (wl-summary-buffer-folder-name))) - (elem wl-summary-mark-action-list)) - (if (eq policy 'copy) - (while elem - (when (eq (wl-summary-action-symbol (car elem)) 'copy) - (wl-summary-register-temp-mark number - (wl-summary-action-mark (car elem)) - data) - (setq elem nil)) - (setq elem (cdr elem))) - (wl-summary-register-temp-mark number mark data) - (setq wl-summary-buffer-prev-refile-destination data)))) + (when (null data) + (error "Destination folder is empty")) + (wl-summary-register-temp-mark number mark data) + (setq wl-summary-buffer-prev-refile-destination data)) (defun wl-summary-get-refile-destination (action number) "Decide refile destination." @@ -479,7 +470,7 @@ Return number if put mark succeed" ;; update buffer. (wl-summary-delete-messages-on-buffer (cdr (car dst-msgs))) (setq wl-summary-buffer-temp-mark-list - (wl-delete-associations + (wl-delete-associations (cdr (car dst-msgs)) wl-summary-buffer-temp-mark-list))) (setq failures @@ -778,15 +769,52 @@ Return number if put mark succeed" "Return t if temporal MARK should be reserved." (member mark wl-summary-reserve-mark-list)) +;; Refile prev destination (defun wl-summary-refile-prev-destination () "Refile message to previously refiled destination." (interactive) (funcall (symbol-function 'wl-summary-refile) + (wl-summary-message-number) wl-summary-buffer-prev-refile-destination) - (if (eq wl-summary-move-direction-downward nil) + (if (and (interactive-p) + (eq wl-summary-move-direction-downward nil)) (wl-summary-prev) (wl-summary-next))) +(defun wl-summary-refile-prev-destination-region (beg end) + "Refile messages in the region to previously refiled destination." + (interactive "r") + (wl-summary-mark-region-subr 'wl-summary-refile + beg end + wl-summary-buffer-prev-refile-destination)) + +(defun wl-thread-refile-prev-destination (arg) + "Refile messages in the thread to previously refiled destination." + (interactive "P") + (wl-thread-call-region-func + 'wl-summary-refile-prev-destination-region + arg)) + +(defun wl-summary-target-mark-refile-prev-destination () + "Refile messages with target mark to previously refiled destination." + (interactive) + (let ((elem wl-summary-mark-action-list) + action) + (while elem + (when (eq (wl-summary-action-symbol (car elem)) 'refile) + (setq action (car elem)) + (setq elem nil)) + (setq elem (cdr elem))) + (wl-summary-target-mark-set-action + (list + (car action) + 'refile-prev-destination + (lambda (&rest args) wl-summary-buffer-prev-refile-destination) + (nth 2 action) + (nth 3 action) + (nth 4 action) + (nth 6 action))))) + (defsubst wl-summary-no-auto-refile-message-p (number) (member (wl-summary-message-mark wl-summary-buffer-elmo-folder number) wl-summary-auto-refile-skip-marks)) @@ -905,7 +933,7 @@ If optional argument NUMBER is specified, unmark message specified by NUMBER." (wl-summary-target-mark-region (point-min) (point-max)) (setq wl-summary-buffer-target-mark-list (elmo-folder-list-messages wl-summary-buffer-elmo-folder - nil 'in-msgdb))) + t 'in-msgdb))) (defun wl-summary-delete-all-mark (mark) (goto-char (point-min)) @@ -913,13 +941,15 @@ If optional argument NUMBER is specified, unmark message specified by NUMBER." (when (string= (wl-summary-temp-mark) mark) (wl-summary-unmark)) (forward-line 1)) - (let (deleted) - (dolist (mark-info wl-summary-buffer-temp-mark-list) - (when (string= (nth 1 mark-info) mark) - (setq deleted (cons mark-info deleted)))) - (dolist (delete deleted) - (setq wl-summary-buffer-temp-mark-list - (delq delete wl-summary-buffer-temp-mark-list))))) + (if (string= mark "*") + (setq wl-summary-buffer-target-mark-list nil) + (let (deleted) + (dolist (mark-info wl-summary-buffer-temp-mark-list) + (when (string= (nth 1 mark-info) mark) + (setq deleted (cons mark-info deleted)))) + (dolist (delete deleted) + (setq wl-summary-buffer-temp-mark-list + (delq delete wl-summary-buffer-temp-mark-list)))))) (defun wl-summary-unmark-all () "Unmark all according to what you input."