+(defconst wl-check-variables-alist
+ '((numberp . elmo-pop3-default-port)
+ (symbolp . elmo-pop3-default-authenticate-type)
+ (numberp . elmo-imap4-default-port)
+ (symbolp . elmo-imap4-default-authenticate-type)
+ (numberp . elmo-nntp-default-port)
+ (numberp . wl-pop-before-smtp-port)
+ (symbolp . wl-pop-before-smtp-authenticate-type)))
+
+(defun wl-check-variables ()
+ (let ((type-variables wl-check-variables-alist)
+ type)
+ (while (setq type (car type-variables))
+ (if (and (eval (cdr type))
+ (not (funcall (car type)
+ (eval (cdr type)))))
+ (error "%s must be %s: %S"
+ (cdr type)
+ (substring (format "%s" (car type)) 0 -1)
+ (eval (cdr type))))
+ (setq type-variables (cdr type-variables)))))
+
+(defun wl-check-variables-2 ()
+ (if (< wl-message-buffer-cache-size 1)
+ (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."))))
+ (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))))))
+