From 1090084de502777173f96c07b2d395681d134489 Mon Sep 17 00:00:00 2001 From: kaoru Date: Sat, 24 Nov 2001 02:00:08 +0000 Subject: [PATCH] * wl-summary.el (wl-summary-write-current-folder): Remove unused local variables. Add error when guess function return invalid value. --- wl/ChangeLog | 6 ++++++ wl/wl-summary.el | 49 ++++++++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 14053e9..e20c30b 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,9 @@ +2001-11-24 TAKAHASHI Kaoru + + * 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 * wl-folder.el (wl-folder-guess-mailing-list-by-refile-rule): diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 651966c..91f3ff9 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -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) "" -- 1.7.10.4