* wl-score.el (wl-summary-score-update-all-lines): Use
[elisp/wanderlust.git] / wl / wl.el
index 921037d..e076fa3 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
 (provide 'wl)                          ; circular dependency
 (require 'wl-folder)
 (require 'wl-summary)
+(require 'wl-action)
 (require 'wl-thread)
 (require 'wl-address)
+(require 'wl-news)
 
 (wl-draft-mode-setup)
 (require 'wl-draft)
@@ -694,8 +696,10 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
          (symbol-value 'wl-summary-subject-function))
     (fset 'wl-summary-subject-filter-func-internal
          (symbol-value 'wl-summary-subject-filter-function))
+    (wl-summary-define-mark-action)
     (setq elmo-no-from wl-summary-no-from-message)
     (setq elmo-no-subject wl-summary-no-subject-message)
+    (wl-news-check)
     (setq wl-init t)
     ;; This hook may contain the functions `wl-plugged-init-icons' and
     ;; `wl-biff-init-icons' for reasons of system internal to accord
@@ -703,7 +707,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
     (run-hooks 'wl-init-hook)))
 
 (defun wl-check-environment (no-check-folder)
-  (unless wl-from (error "Please set `wl-from' to your mail address."))
+  (unless wl-from (error "Please set `wl-from' to your mail address"))
   ;; Message-ID
   (when wl-insert-message-id
     (let ((message-id (funcall wl-message-id-function))
@@ -711,10 +715,10 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
       (unless (string-match "^<\\([^@]*\\)@\\([^@]*\\)>$" message-id)
        (cond
         ((string-match "@" wl-message-id-domain)
-         (error "Please remove `@' from `wl-message-id-domain'."))
+         (error "Please remove `@' from `wl-message-id-domain'"))
         (t
          (error
-          "Check around `wl-message-id-function' to get valid Message-ID string."))))
+          "Check around `wl-message-id-function' to get valid Message-ID string"))))
       (setq domain (match-string 2 message-id))
       (if (or (not (string-match "[^.]\\.[^.]" domain))
              (string= domain "localhost.localdomain"))
@@ -776,13 +780,23 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 
 (defun wl-check-variables-2 ()
   (if (< wl-message-buffer-cache-size 1)
-      (error "`wl-message-buffer-cache-size' must be larger than 0."))
+      (error "`wl-message-buffer-cache-size' must be larger than 0"))
   (when wl-message-buffer-prefetch-depth
     (if (not (< wl-message-buffer-prefetch-depth
                wl-message-buffer-cache-size))
        (error (concat
                "`wl-message-buffer-prefetch-depth' must be smaller than "
-               "`wl-message-buffer-cache-size' - 1.")))))
+               "`wl-message-buffer-cache-size' - 1."))))
+  (let (case-fold-search)
+    (unless (string-match "%T" wl-summary-line-format)
+      (error "`wl-summary-line-format' must contain %%T and %%P"))
+    (unless (string-match "%P" wl-summary-line-format)
+      (error "`wl-summary-line-format' must contain %%T and %%P"))
+    (dolist (pair wl-folder-summary-line-format-alist)
+      (unless (string-match "%T" (cdr pair))
+       (error "Format `%s' must contain %%T and %%P" (cdr pair)))
+      (unless (string-match "%P" (cdr pair))
+       (error "Format `%s' must contain %%T and %%P" (cdr pair))))))
 
 ;;;###autoload
 (defun wl (&optional arg)
@@ -809,7 +823,8 @@ If ARG (prefix argument) is specified, folder checkings are skipped."
                (wl-check-variables)
                (wl-check-variables-2)
                (message "Checking type of variables...done")))
-         (wl-plugged-init (wl-folder arg))
+         (let ((inhibit-quit t))
+           (wl-plugged-init (wl-folder arg)))
          (unless arg
            (run-hooks 'wl-auto-check-folder-pre-hook)
            (wl-folder-auto-check)
@@ -818,7 +833,6 @@ If ARG (prefix argument) is specified, folder checkings are skipped."
       (error
        (if (buffer-live-p demo-buf)
           (kill-buffer demo-buf))
-       (setq wl-init nil)
        (signal (car obj)(cdr obj)))
       (quit))
     (if (buffer-live-p demo-buf)