X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=wl%2Fwl.el;h=ea1807b085fa210363af5162c89eb8682c3d29fe;hb=52061841b6997afec3a3108019c9362c35e4864b;hp=cbff2e66273c58ebe483773467496178fe980c3a;hpb=75a407dc83024b3fc63e752e95372a5ee391d6bf;p=elisp%2Fwanderlust.git diff --git a/wl/wl.el b/wl/wl.el index cbff2e6..ea1807b 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -58,6 +58,7 @@ (require 'wl-summary) (require 'wl-thread) (require 'wl-address) +(require 'wl-news) (wl-draft-mode-setup) (require 'wl-draft) @@ -696,6 +697,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." (symbol-value 'wl-summary-subject-filter-function)) (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,32 +705,27 @@ 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'")) + (unless wl-from (error "Please set `wl-from' to your mail address.")) ;; Message-ID - (let (from domain) - (if wl-message-id-use-wl-from - (if (and (setq from (wl-address-header-extract-address wl-from)) - (string-match "^\\(.*\\)@\\(.*\\)$" from)) - (setq domain (match-string 2 from)) - (error "Please set `wl-from' to get valid Message-ID string.")) - (setq domain - (or wl-message-id-domain - (if wl-local-domain - (concat (system-name) "." wl-local-domain) - (system-name))))) - (unless (string-match "[^.]\\.[^.]" domain) - (error "Please set `wl-local-domain' to get valid FQDN")) - (if (string-match "@" domain) - (error "Please remove `@' from `wl-message-id-domain'")) - (if (string= wl-local-domain "localdomain") - (error "Please set `wl-local-domain'")) - (if (string= wl-message-id-domain "localhost.localdomain") - (error "Please set `wl-message-id-domain'"))) + (when wl-insert-message-id + (let ((message-id (funcall wl-message-id-function)) + domain) + (unless (string-match "^<\\([^@]*\\)@\\([^@]*\\)>$" message-id) + (cond + ((string-match "@" 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.")))) + (setq domain (match-string 2 message-id)) + (if (or (not (string-match "[^.]\\.[^.]" domain)) + (string= domain "localhost.localdomain")) + (elmo-warning + "Please set `wl-message-id-domain' to get valid Message-ID string.")))) ;; folders (when (not no-check-folder) (let ((draft-folder (wl-folder-get-elmo-folder wl-draft-folder)) (queue-folder (wl-folder-get-elmo-folder wl-queue-folder)) - (trash-folder (wl-folder-get-elmo-folder wl-trash-folder)) (lost+found-folder (wl-folder-get-elmo-folder elmo-lost+found-folder))) (if (not (elmo-folder-message-file-p draft-folder)) @@ -747,12 +744,6 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." (elmo-folder-create queue-folder) (error "Queue Folder is not created"))) (when (not (eq no-check-folder 'wl-draft)) - (unless (elmo-folder-exists-p trash-folder) - (if (y-or-n-p - (format "Trash Folder %s does not exist, create it? " - wl-trash-folder)) - (elmo-folder-create trash-folder) - (error "Trash Folder is not created"))) (unless (elmo-folder-exists-p lost+found-folder) (elmo-folder-create lost+found-folder))) ;; tmp dir @@ -793,7 +784,17 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." 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) @@ -812,17 +813,16 @@ If ARG (prefix argument) is specified, folder checkings are skipped." (condition-case obj (progn (if check - (condition-case nil - (progn - (message "Checking environment...") - (wl-check-environment arg) - (message "Checking environment...done")) - ((error quit)))) - (message "Checking type of variables...") - (wl-check-variables) - (wl-check-variables-2) - (message "Checking type of variables...done") - (wl-plugged-init (wl-folder arg)) + (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"))) + (let ((inhibit-quit t)) + (wl-plugged-init (wl-folder arg))) (unless arg (run-hooks 'wl-auto-check-folder-pre-hook) (wl-folder-auto-check) @@ -831,7 +831,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) @@ -844,32 +843,34 @@ If ARG (prefix argument) is specified, folder checkings are skipped." (defun wl-other-frame (&optional arg) "Pop up a frame to read messages via Wanderlust." (interactive) - (let ((focusing-functions (append '(raise-frame select-frame) - (if (fboundp 'x-focus-frame) - '(x-focus-frame) - '(focus-frame)))) - (folder (get-buffer wl-folder-buffer-name)) - window frame wl-folder-use-frame) - (if (and folder - (setq window (get-buffer-window folder t)) - (window-live-p window) - (setq frame (window-frame window))) - (progn - (while focusing-functions - (funcall (car focusing-functions) frame) - (setq focusing-functions (cdr focusing-functions))) - (wl arg)) - (setq frame (make-frame)) - (while focusing-functions - (funcall (car focusing-functions) frame) - (setq focusing-functions (cdr focusing-functions))) - (setq wl-delete-startup-frame-function - `(lambda () - (setq wl-delete-startup-frame-function nil) - (let ((frame ,frame)) - (if (eq (selected-frame) frame) - (delete-frame frame))))) - (wl arg)))) + (if wl-folder-use-frame + (wl arg) + (let ((focusing-functions (append '(raise-frame select-frame) + (if (fboundp 'x-focus-frame) + '(x-focus-frame) + '(focus-frame)))) + (folder (get-buffer wl-folder-buffer-name)) + window frame wl-folder-use-frame) + (if (and folder + (setq window (get-buffer-window folder t)) + (window-live-p window) + (setq frame (window-frame window))) + (progn + (while focusing-functions + (funcall (car focusing-functions) frame) + (setq focusing-functions (cdr focusing-functions))) + (wl arg)) + (setq frame (make-frame)) + (while focusing-functions + (funcall (car focusing-functions) frame) + (setq focusing-functions (cdr focusing-functions))) + (setq wl-delete-startup-frame-function + `(lambda () + (setq wl-delete-startup-frame-function nil) + (let ((frame ,frame)) + (if (eq (selected-frame) frame) + (delete-frame frame))))) + (wl arg))))) ;; Define some autoload functions WL might use. (eval-and-compile