* wl.el (wl): Do not check variables if check is nil.
authorokada <okada>
Tue, 2 Apr 2002 19:41:59 +0000 (19:41 +0000)
committerokada <okada>
Tue, 2 Apr 2002 19:41:59 +0000 (19:41 +0000)
* wl-utils.el (wl-collect-draft): New function.
* wl-folder.el (wl-folder-suspend): Put summary buffers
and draft buffers at the end of buffer list.
* wl-draft.el (wl-jump-to-draft-folder): Use `wl-collect-draft'.

wl/ChangeLog
wl/wl-draft.el
wl/wl-folder.el
wl/wl-util.el
wl/wl.el

index d64334e..13fdc23 100644 (file)
@@ -1,3 +1,11 @@
+2002-04-03  Kenichi OKADA  <okada@opaopa.org>
+
+       * wl.el (wl): Do not check variables if check is nil.
+       * wl-utils.el (wl-collect-draft): New function. 
+       * wl-folder.el (wl-folder-suspend): Put summary buffers
+       and draft buffers at the end of buffer list.
+       * wl-draft.el (wl-jump-to-draft-folder): Use `wl-collect-draft'.
+
 2002-04-02  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-message.el (wl-message-buffer-prefetch-get-next): Use while
index 0748f8c..03f2bf9 100644 (file)
@@ -2152,26 +2152,18 @@ Derived from `message-save-drafts' in T-gnus."
   (interactive "P")
   (if arg
       (wl-jump-to-draft-folder)
-    (let ((bufs (buffer-list))
-         (draft-regexp (concat
-                        "^" (regexp-quote
-                             (elmo-localdir-folder-directory-internal
-                              (wl-folder-get-elmo-folder wl-draft-folder)))))
-         buf draft-bufs)
-      (while bufs
-       (if (and
-            (setq buf (with-current-buffer (car bufs)
-                        wl-draft-buffer-file-name))
-            (string-match draft-regexp buf))
-           (setq draft-bufs (cons (buffer-name (car bufs)) draft-bufs)))
-       (setq bufs (cdr bufs)))
+    (let ((draft-bufs (wl-collect-draft))
+         buf)
       (cond
        ((null draft-bufs)
        (message "No draft buffer exist."))
        (t
        (setq draft-bufs
-             (sort draft-bufs (function (lambda (a b) (not (string< a b))))))
-       (if (setq buf (cdr (member (buffer-name) draft-bufs)))
+             (sort (mapcar 'buffer-name draft-bufs)
+                   (function (lambda (a b)
+                               (not (string< a b))))))
+       (if (setq buf (cdr (member (buffer-name)
+                                  draft-bufs)))
            (setq buf (car buf))
          (setq buf (car draft-bufs)))
        (switch-to-buffer buf))))))
index 629bb44..2e0d1b9 100644 (file)
@@ -2239,6 +2239,10 @@ Use `wl-subscribed-mailing-list'."
   ;(if (fboundp 'mmelmo-cleanup-entity-buffers)
   ;(mmelmo-cleanup-entity-buffers))
   (bury-buffer wl-folder-buffer-name)
+  (dolist (summary-buf (wl-collect-summary))
+    (bury-buffer summary-buf))
+  (dolist (draft-buf (wl-collect-draft))
+    (bury-buffer draft-buf))
   (delete-windows-on wl-folder-buffer-name t))
 
 (defun wl-folder-info-save ()
index 6458183..43e4b4e 100644 (file)
@@ -575,6 +575,22 @@ that `read' can handle, whenever this is possible."
      (buffer-list))
     result))
 
+(defun wl-collect-draft ()
+  (let ((draft-regexp (concat
+                      "^" (regexp-quote
+                           (elmo-localdir-folder-directory-internal
+                            (wl-folder-get-elmo-folder wl-draft-folder)))))
+       result buf)
+    (mapcar
+     (function (lambda (x)
+                (if (and
+                     (setq buf (with-current-buffer x
+                                 wl-draft-buffer-file-name))
+                     (string-match draft-regexp buf))
+                    (setq result (nconc result (list x))))))
+     (buffer-list))
+    result))
+
 (static-if (fboundp 'read-directory-name)
     (defalias 'wl-read-directory-name 'read-directory-name)
   (defun wl-read-directory-name (prompt dir)
index 933ae53..093a7d4 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -804,11 +804,11 @@ If ARG (prefix argument) is specified, folder checkings are skipped."
              (progn
                (message "Checking environment...")
                (wl-check-environment arg)
-               (message "Checking environment...done")))
-         (message "Checking type of variables...")
-         (wl-check-variables)
-         (wl-check-variables-2)
-         (message "Checking type of variables...done")
+               (message "Checking environment...done")
+               (message "Checking type of variables...")
+               (wl-check-variables)
+               (wl-check-variables-2)
+               (message "Checking type of variables...done")))
          (wl-plugged-init (wl-folder arg))
          (unless arg
            (run-hooks 'wl-auto-check-folder-pre-hook)