From d0c72c4add8721ae03ef62c4600ca41168474313 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 4 Apr 2000 16:41:33 +0000 Subject: [PATCH] * wl-refile.el (wl-refile-expand-newtext): Add `original' argument. Use substring of `original' instead of buffer-substring. (wl-refile-evaluate-rule): Set `original' argument of wl-refile-expand-newtext. * wl-summary.el (wl-summary-auto-refile-check-refile-rule-alist-subr, wl-summary-auto-refile-check-refile-rule-alist): Eliminated. (wl-summary-auto-refile): Check existence of destination folder just before marking. --- wl/ChangeLog | 13 +++++++++++++ wl/wl-refile.el | 9 +++++---- wl/wl-summary.el | 41 +++++------------------------------------ 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 149cdf3..aee7fef 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,16 @@ +2000-04-05 Yuuichi Teranishi + + * wl-refile.el (wl-refile-expand-newtext): Add `original' argument. + Use substring of `original' instead of buffer-substring. + (wl-refile-evaluate-rule): + Set `original' argument of wl-refile-expand-newtext. + + * wl-summary.el + (wl-summary-auto-refile-check-refile-rule-alist-subr, + wl-summary-auto-refile-check-refile-rule-alist): Eliminated. + (wl-summary-auto-refile): Check existence of destination folder just + before marking. + 2000-04-05 TAKAHASHI Kaoru * wl-refile.el (wl-refile-evaluate-rule): Fixed problem diff --git a/wl/wl-refile.el b/wl/wl-refile.el index 7bdb661..614c697 100644 --- a/wl/wl-refile.el +++ b/wl/wl-refile.el @@ -4,7 +4,7 @@ ;; Author: Yuuichi Teranishi ;; Keywords: mail, net news -;; Time-stamp: <2000-04-04 11:38:57 teranisi> +;; Time-stamp: <00/04/05 01:20:16 teranisi> ;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen). @@ -158,7 +158,8 @@ If RULE does not match ENTITY, returns nil." value) (setq guess (wl-refile-expand-newtext (wl-refile-evaluate-rule (cdr (car pairs)) - entity)))) + entity) + value))) (setq pairs nil) (setq pairs (cdr pairs)))) guess) @@ -176,7 +177,7 @@ If RULE does not match ENTITY, returns nil." entity) (elmo-msgdb-overview-entity-get-extra-field entity field)))) -(defun wl-refile-expand-newtext (newtext) +(defun wl-refile-expand-newtext (newtext original) (let ((len (length newtext)) (pos 0) c expanded beg N did-expand) @@ -202,7 +203,7 @@ If RULE does not match ENTITY, returns nil." (setq N 0) (setq N (- c ?0))) (when (match-beginning N) - (push (buffer-substring (match-beginning N) (match-end N)) + (push (substring original (match-beginning N) (match-end N)) expanded)))) (setq pos (1+ pos))) (if did-expand diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 5aaf9ad..6a9dc5d 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -4,7 +4,7 @@ ;; Author: Yuuichi Teranishi ;; Keywords: mail, net news -;; Time-stamp: <2000-04-04 13:36:01 teranisi> +;; Time-stamp: <2000-04-05 00:39:28 teranisi> ;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen). @@ -3404,43 +3404,9 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." (defsubst wl-summary-no-auto-refile-message-p (msg mark-alist) (member (cadr (assq msg mark-alist)) wl-summary-auto-refile-skip-marks)) -(defun wl-summary-auto-refile-check-refile-rule-alist-subr (rule dsts) - "Collect destination folders from rule." - (if (stringp rule) - (if (member rule dsts) - dsts - (setq dsts (cons rule dsts))) - ;; A rule. - (let (pairs sub-dsts) - (setq pairs (cdr rule)) - (while pairs - (setq dsts - (wl-summary-auto-refile-check-refile-rule-alist-subr - (cdr (car pairs)) dsts)) - (setq pairs (cdr pairs)))) - dsts)) - -(defun wl-summary-auto-refile-check-refile-rule-alist () - (when wl-refile-rule-alist - (message "Checking destination folders...") - (let ((rules wl-refile-rule-alist) - dsts) - (while rules - (setq dsts - (append - (wl-summary-auto-refile-check-refile-rule-alist-subr - (car rules) nil) - dsts)) - (setq rules (cdr rules))) - (mapcar - 'wl-folder-confirm-existence - dsts)) - (message "Checking destination folders...done."))) - (defun wl-summary-auto-refile (&optional open-all) "Set refile mark automatically according to wl-refile-guess-by-rule." (interactive "P") - (wl-summary-auto-refile-check-refile-rule-alist) (message "Marking...") (save-excursion (if (and (eq wl-summary-buffer-view 'thread) @@ -3451,6 +3417,7 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." wl-summary-buffer-msgdb)) (mark-alist (elmo-msgdb-get-mark-alist wl-summary-buffer-msgdb)) + checked-dsts (count 0) number dst thr-entity) (goto-line 1) @@ -3463,7 +3430,9 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." (elmo-msgdb-overview-get-entity-by-number overview number))) (not (equal dst spec))) - ;(wl-folder-confirm-existence dst) + (when (not (member dst checked-dsts)) + (wl-folder-confirm-existence dst) + (setq checked-dsts (cons dst checked-dsts))) (if (wl-summary-refile dst number) (incf count)) (message "Marking...%d message(s)." count)) -- 1.7.10.4