* wl-summary.el (wl-summary-write-current-folder): Remove unused
authorkaoru <kaoru>
Sat, 24 Nov 2001 02:00:08 +0000 (02:00 +0000)
committerkaoru <kaoru>
Sat, 24 Nov 2001 02:00:08 +0000 (02:00 +0000)
local variables.  Add error when guess function return invalid
value.

wl/ChangeLog
wl/wl-summary.el

index 14053e9..e20c30b 100644 (file)
@@ -1,3 +1,9 @@
+2001-11-24  TAKAHASHI Kaoru  <kaoru@kaisei.org>
+
+       * wl-summary.el (wl-summary-write-current-folder): Remove unused
+       local variables.  Add error when guess function return invalid
+       value.
+
 2001-11-23  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * wl-folder.el (wl-folder-guess-mailing-list-by-refile-rule):
index 651966c..91f3ff9 100644 (file)
@@ -4911,31 +4911,30 @@ When guess function return nil, challenge next guess-function.")
   "Write message to current FOLDER's newsgroup or mailing-list.
 Use function list is `wl-summary-write-current-folder-functions'."
   (interactive)
-  (let (newsgroups to cc)
-    ;; default FOLDER is current buffer folder
-    (setq folder (or folder (wl-summary-buffer-folder-name)))
-    (let ((flist wl-summary-write-current-folder-functions)
-         guess-list)
-      (while flist
-       (setq guess-list (funcall (car flist) folder))
-       (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:
-               (nth 1 guess-list) nil  ; Cc:
-               (nth 2 guess-list)      ; Newsgroups:
-               nil nil nil nil nil nil nil
-               folder)
-      (run-hooks 'wl-mail-setup-hook)
-      (mail-position-on-field "Subject"))))
+  ;; default FOLDER is current buffer folder
+  (setq folder (or folder (wl-summary-buffer-folder-name)))
+  (let ((func-list wl-summary-write-current-folder-functions)
+       guess-list guess-func)
+    (while func-list
+      (setq guess-list (funcall (car func-list) folder))
+      (if (null guess-list)
+         (setq func-list (cdr func-list))
+       (setq guess-func (car func-list))
+       (setq func-list nil)))
+    (when (null guess-func)
+      (error "Can't guess by folder %s" folder))
+    (unless (or (stringp (nth 0 guess-list))
+               (stringp (nth 1 guess-list))
+               (stringp (nth 2 guess-list)))
+      (error "Invalid value return guess function `%s'"
+            (symbol-name guess-func)))
+    (wl-draft (nth 0 guess-list) nil nil ; To:
+             (nth 1 guess-list) nil    ; Cc:
+             (nth 2 guess-list)        ; Newsgroups:
+             nil nil nil nil nil nil nil
+             folder)
+    (run-hooks 'wl-mail-setup-hook)
+    (mail-position-on-field "Subject")))
 
 (defun wl-summary-forward (&optional without-setup-hook)
   ""