+2000-04-05 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * 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 <kaoru@kaisei.org>
* wl-refile.el (wl-refile-evaluate-rule): Fixed problem
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; 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).
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)
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)
(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
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; 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).
(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)
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)
(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))