2001-11-23 TAKAHASHI Kaoru <kaoru@kaisei.org>
+ * wl-folder.el (wl-folder-guess-mailing-list-by-refile-rule):
+ Change local variable name.
+ (wl-folder-guess-mailing-list-by-folder-name): Ditto.
+ (wl-folder-get-newsgroups): Return nil when non-news folder.
+ * wl-summary.el (wl-summary-write-current-folder): State through
+ when guess-list return nil.
+ (wl-summary-write-current-folder-functions): Fixed docstring.
+
* wl.el (wl-exit): Changed confirm message.
* wl.el (wl-init): (require 'mime-setup) move to toplevel.
(defun wl-folder-get-newsgroups (folder)
"Return Newsgroups field value string for FOLDER newsgroup.
If FOLDER is multi, return comma separated string (cross post)."
- (list nil nil (mapconcat 'identity
- (elmo-folder-newsgroups
- (wl-folder-get-elmo-folder folder))
- ",")))
+ (let ((nlist (elmo-folder-newsgroups
+ (wl-folder-get-elmo-folder folder))))
+ (if nlist
+ (list nil nil (mapconcat 'identity nlist ","))
+ nil)))
(defun wl-folder-guess-mailing-list-by-refile-rule (entity)
"Return ML address guess by FOLDER.
(let ((flist
(elmo-folder-get-primitive-list
(wl-folder-get-elmo-folder entity)))
- fld ret mlist)
+ fld mladdr to)
(while (setq fld (car flist))
- (if (setq ret
- (wl-folder-guess-mailing-list-by-refile-rule-subr
- (elmo-folder-name-internal fld)))
- (setq mlist (if (stringp mlist)
- (concat mlist ", " ret)
- ret)))
+ (setq mladdr (wl-folder-guess-mailing-list-by-refile-rule-subr
+ (elmo-folder-name-internal fld)))
+ (when mladdr
+ (setq to (if (stringp to)
+ (concat to ", " mladdr)
+ mladdr)))
(setq flist (cdr flist)))
- (if mlist
- (list mlist nil nil))))
+ (if (stringp to)
+ (list to nil nil)
+ nil)))
(defun wl-folder-guess-mailing-list-by-refile-rule-subr (entity)
(unless (memq (elmo-folder-type entity)
(let ((flist
(elmo-folder-get-primitive-list
(wl-folder-get-elmo-folder entity)))
- fld ret mlist)
+ fld mladdr to)
(while (setq fld (car flist))
- (if (setq ret
- (wl-folder-guess-mailing-list-by-folder-name-subr
- (elmo-folder-name-internal fld)))
- (setq mlist (if (stringp mlist)
- (concat mlist ", " ret)
- ret)))
+ (setq mladdr (wl-folder-guess-mailing-list-by-folder-name-subr
+ (elmo-folder-name-internal fld)))
+ (when mladdr
+ (setq to (if (stringp to)
+ (concat to ", " mladdr)
+ mladdr)))
(setq flist (cdr flist)))
- (if mlist
- (list mlist nil nil))))
+ (if (stringp to)
+ (list to nil nil)
+ nil)))
(defun wl-folder-guess-mailing-list-by-folder-name-subr (entity)
(when (memq (elmo-folder-type entity)
wl-folder-guess-mailing-list-by-refile-rule
wl-folder-guess-mailing-list-by-folder-name)
"Newsgroups or Mailing List address guess functions list.
-Call from `wl-summary-write-current-folder'")
+Call from `wl-summary-write-current-folder'.
+When guess function return nil, challenge next guess-function.")
(defun wl-summary-write-current-folder (&optional folder)
"Write message to current FOLDER's newsgroup or mailing-list.
guess-list)
(while flist
(setq guess-list (funcall (car flist) folder))
- (if (or (nth 0 guess-list) ; To:
-;;; (nth 1 guess-list) ; Cc:
- (nth 2 guess-list)) ; Newsgroups:
- (setq flist nil)
- (setq flist (cdr flist))))
+ (cond ((null guess-list)
+ (setq flist (cdr flist)))
+ ;; To: or Newsgroups:
+ ((or (stringp (nth 0 guess-list))
+ (stringp (nth 2 guess-list)))
+ (setq flist nil))
+ ;; (nil X nil) or error case
+ (t
+ (setq flist (cdr flist)))))
(when (null guess-list)
(error "Can't guess by folder %s" folder))
(wl-draft (nth 0 guess-list) nil nil ; To: