From: okada Date: Tue, 2 Apr 2002 19:41:59 +0000 (+0000) Subject: * wl.el (wl): Do not check variables if check is nil. X-Git-Tag: elmo-mark-root~223 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e836f7a8ae2ec8eba7f155a58c5de7252cfc01ab;p=elisp%2Fwanderlust.git * 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'. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index d64334e..13fdc23 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,11 @@ +2002-04-03 Kenichi OKADA + + * 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 * wl-message.el (wl-message-buffer-prefetch-get-next): Use while diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 0748f8c..03f2bf9 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -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)))))) diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 629bb44..2e0d1b9 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -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 () diff --git a/wl/wl-util.el b/wl/wl-util.el index 6458183..43e4b4e 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -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) diff --git a/wl/wl.el b/wl/wl.el index 933ae53..093a7d4 100644 --- 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)