1 ;;; wl.el -- Wanderlust bootstrap.
3 ;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
4 ;; Copyright (C) 1998,1999,2000 Masahiro MURATA <muse@ba2.so-net.ne.jp>
6 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
7 ;; Masahiro MURATA <muse@ba2.so-net.ne.jp>
8 ;; Keywords: mail, net news
10 ;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen).
12 ;; This program is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; This program is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
35 (require 'wl-version) ; reduce recursive-load-depth
38 (unless (and (fboundp 'defgroup)
41 (defmacro defgroup (&rest args))
42 (defmacro defcustom (symbol value &optional doc &rest args)
43 (let ((doc (concat "*" (or doc ""))))
44 (` (defvar (, symbol) (, value) (, doc))))))
58 (provide 'wl) ; circular dependency
69 (require 'wl-highlight)
81 (defun wl-plugged-init (&optional make-alist)
82 (setq elmo-plugged wl-plugged)
83 (if wl-reset-plugged-alist
84 (elmo-set-plugged elmo-plugged))
86 (wl-make-plugged-alist))
88 (setq elmo-plugged (setq wl-plugged (elmo-plugged-p))
89 wl-modeline-plug-status wl-plugged)
91 (wl-toggle-plugged t 'flush)))
93 (defun wl-toggle-plugged (&optional arg queue-flush-only)
95 (elmo-quit) ; Disconnect current connection.
96 (unless queue-flush-only
101 (setq wl-plugged nil))
102 (t (setq wl-plugged (null wl-plugged))))
103 (elmo-set-plugged wl-plugged))
104 (setq elmo-plugged wl-plugged
105 wl-modeline-plug-status wl-plugged)
107 (let ((summaries (wl-collect-summary)))
109 (set-buffer (pop summaries))
110 (elmo-folder-commit wl-summary-buffer-elmo-folder)
111 (wl-summary-set-message-modified))))
112 (setq wl-biff-check-folders-running nil)
116 (elmo-dop-queue-flush)
117 (unless queue-flush-only (wl-biff-start))
118 (if (and wl-draft-enable-queuing
120 (wl-draft-queue-flush))
121 ;; (when (and (eq major-mode 'wl-summary-mode)
122 ;; (elmo-folder-plugged-p wl-summary-buffer-elmo-folder))
123 ;; (let* ((msgdb-dir (elmo-folder-msgdb-path
124 ;; wl-summary-buffer-elmo-folder))
125 ;; (seen-list (elmo-msgdb-seen-load msgdb-dir)))
127 ;; (wl-summary-flush-pending-append-operations seen-list))
128 ;; (elmo-msgdb-seen-save msgdb-dir seen-list)))
129 (run-hooks 'wl-plugged-hook))
131 (run-hooks 'wl-unplugged-hook))
132 (force-mode-line-update t))
136 (defvar wl-plugged-port-label-alist
137 (list (cons 119 "nntp")
140 ;;(cons elmo-pop-before-smtp-port "pop3")
142 (defconst wl-plugged-switch-variables
143 '(("Queuing" . wl-draft-enable-queuing)
144 ("AutoFlushQueue" . wl-auto-flush-queue)
145 ("DisconnectedOperation" . elmo-enable-disconnected-operation)))
147 (defvar wl-plugged-buf-name "Plugged")
148 (defvar wl-plugged-mode-map nil)
149 (defvar wl-plugged-alist nil)
150 (defvar wl-plugged-switch nil)
151 (defvar wl-plugged-winconf nil)
152 (defvar wl-plugged-sending-queue-alist nil)
153 (defvar wl-plugged-dop-queue-alist nil)
154 (defvar wl-plugged-alist-modified nil)
156 (defvar wl-plugged-mode-menu-spec
158 ["Toggle plugged" wl-plugged-toggle t]
159 ["Toggle All plugged" wl-plugged-toggle-all t]
160 ["Prev Port" wl-plugged-move-to-previous t]
161 ["Next Port" wl-plugged-move-to-next t]
162 ["Prev Server" wl-plugged-move-to-previous-server t]
163 ["Next Server" wl-plugged-move-to-next-server t]
164 ["Flush queue" wl-plugged-flush-queue t]
166 ["Exit" wl-plugged-exit t]))
170 (defun wl-plugged-setup-mouse ()
171 (define-key wl-plugged-mode-map 'button2 'wl-plugged-click))
173 (defun wl-plugged-setup-mouse ())
174 (defun wl-plugged-setup-mouse ()
175 (define-key wl-plugged-mode-map [mouse-2] 'wl-plugged-click)))))
177 (unless wl-plugged-mode-map
178 (setq wl-plugged-mode-map (make-sparse-keymap))
179 (define-key wl-plugged-mode-map " " 'wl-plugged-toggle)
180 (define-key wl-plugged-mode-map "\C-m" 'wl-plugged-toggle)
181 (define-key wl-plugged-mode-map "\M-t" 'wl-plugged-toggle-all)
182 (define-key wl-plugged-mode-map "q" 'wl-plugged-exit)
183 (define-key wl-plugged-mode-map "\C-t" 'wl-plugged-exit)
184 (define-key wl-plugged-mode-map "F" 'wl-plugged-flush-queue)
185 (define-key wl-plugged-mode-map "P" 'wl-plugged-move-to-previous-server)
186 (define-key wl-plugged-mode-map "N" 'wl-plugged-move-to-next-server)
187 (define-key wl-plugged-mode-map "p" 'wl-plugged-move-to-previous)
188 (define-key wl-plugged-mode-map "n" 'wl-plugged-move-to-next)
189 (define-key wl-plugged-mode-map "\e\t" 'wl-plugged-move-to-previous)
190 (define-key wl-plugged-mode-map "\t" 'wl-plugged-move-to-next)
191 (wl-plugged-setup-mouse)
195 "Menu used in Plugged mode."
196 wl-plugged-mode-menu-spec))
198 (defun wl-plugged-mode ()
199 "Mode for setting Wanderlust plugged.
200 See info under Wanderlust for full documentation.
203 \\{wl-plugged-mode-map}
205 Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
207 (kill-all-local-variables)
208 (use-local-map wl-plugged-mode-map)
209 (setq major-mode 'wl-plugged-mode)
210 (setq mode-name "Plugged")
211 (easy-menu-add wl-plugged-mode-menu)
212 (wl-mode-line-buffer-identification)
213 (setq wl-plugged-switch wl-plugged)
214 (setq wl-plugged-alist-modified nil)
215 (setq buffer-read-only t)
216 (run-hooks 'wl-plugged-mode-hook))
218 (defmacro wl-plugged-string (plugged &optional time)
219 (` (if (, time) wl-plugged-auto-off
220 (if (, plugged) wl-plugged-plug-on wl-plugged-plug-off))))
222 (defmacro wl-plugged-server-indent ()
223 (` (make-string wl-plugged-server-indent ? )))
225 (defun wl-plugged-set-variables ()
226 (setq wl-plugged-sending-queue-alist
227 (wl-plugged-sending-queue-info))
228 (setq wl-plugged-dop-queue-alist
229 (wl-plugged-dop-queue-info))
230 (setq wl-plugged-alist
231 (sort (copy-sequence elmo-plugged-alist)
233 (string< (caar a) (caar b))))))
235 (defun wl-plugged-sending-queue-info ()
236 ;; sending queue status
237 (let (alist msgs sent-via server port)
238 (setq msgs (elmo-folder-list-messages
239 (wl-folder-get-elmo-folder wl-queue-folder)))
241 (setq sent-via (wl-draft-queue-info-operation (car msgs) 'get-sent-via))
243 (when (eq (nth 1 (car sent-via)) 'unplugged)
244 (setq server (car (nth 2 (car sent-via)))
245 port (cdr (nth 2 (car sent-via))))
246 (elmo-plugged-p server port) ;; add elmo-plugged-alist if nothing.
248 (wl-append-assoc-list
252 (setq sent-via (cdr sent-via)))
253 (setq msgs (cdr msgs)))
256 (defun wl-plugged-sending-queue-status (qinfo)
257 ;; sending queue status
258 (let ((len (length (cdr qinfo))))
259 (concat (wl-plugged-set-folder-icon
261 (wl-folder-get-petname wl-queue-folder))
263 (format ": %d msgs (" len)
264 (format ": %d msg (" len))
265 (mapconcat (function int-to-string) (cdr qinfo) ",")
268 (defun wl-plugged-dop-queue-info ()
271 (elmo-dop-queue (copy-sequence elmo-dop-queue))
272 dop-queue last alist server-info
274 ;(elmo-dop-queue-load)
275 (elmo-dop-queue-merge)
276 (setq dop-queue (sort elmo-dop-queue '(lambda (a b)
277 (string< (elmo-dop-queue-fname a)
278 (elmo-dop-queue-fname b)))))
279 (wl-append dop-queue (list nil)) ;; terminate(dummy)
280 (when (car dop-queue)
281 (setq last (elmo-dop-queue-fname (car dop-queue)))) ;; first
283 (when (car dop-queue)
284 (setq ope (cons (elmo-dop-queue-method (car dop-queue))
288 (elmo-dop-queue-arguments (car dop-queue))))
289 (car (elmo-dop-queue-arguments
290 (car dop-queue))))))))
291 (if (and (car dop-queue)
292 (string= last (elmo-dop-queue-fname (car dop-queue))))
293 (wl-append operation (list ope))
294 ;;(setq count (1+ count))
295 (when (and last (setq server-info (elmo-net-port-info
296 (wl-folder-get-elmo-folder last))))
298 (wl-append-assoc-list
300 (cons last operation)
302 (when (car dop-queue)
303 (setq last (elmo-dop-queue-fname (car dop-queue))
304 operation (list ope))))
305 (setq dop-queue (cdr dop-queue)))
308 (defun wl-plugged-dop-queue-status (qinfo &optional column)
310 (let ((operations (cdr qinfo))
311 (column (or column wl-plugged-queue-status-column)))
313 '(lambda (folder-ope)
314 (concat (wl-plugged-set-folder-icon
316 (wl-folder-get-petname (car folder-ope)))
321 (format "%s:%d" (car ope) (cdr ope))
322 (format "%s" (car ope))))
323 (cdr folder-ope) ",")
326 (concat "\n" (wl-set-string-width column "")))))
328 (defun wl-plugged-drawing (plugged-alist)
329 (let ((buffer-read-only nil)
330 (alist plugged-alist)
331 (vars wl-plugged-switch-variables)
332 last server port stream-type label plugged time
333 line len qinfo column)
336 (insert (format "%s:[%s]%s"
338 (wl-plugged-string (symbol-value (cdar vars)))
339 (if (cdr vars) " " "")))
340 (setq vars (cdr vars)))
342 (let ((elmo-plugged wl-plugged-switch))
343 (setq line (format "[%s](wl-plugged)"
344 (wl-plugged-string (elmo-plugged-p))))
345 ;; sending queue status
346 (when (setq qinfo (assoc (cons nil nil) wl-plugged-sending-queue-alist))
348 (wl-set-string-width wl-plugged-queue-status-column line)
349 (wl-plugged-sending-queue-status qinfo))))
352 (setq server (nth 0 (caar alist))
353 port (nth 1 (caar alist))
354 stream-type (nth 2 (caar alist))
355 label (nth 1 (car alist))
356 plugged (nth 2 (car alist))
357 time (nth 3 (car alist)))
358 (unless (string= last server)
360 (insert (format "%s[%s]%s\n"
361 (wl-plugged-server-indent)
363 (elmo-plugged-p server nil plugged-alist))
369 (make-string wl-plugged-port-indent ? )
370 (wl-plugged-string plugged time)
377 (cdr (assq port wl-plugged-port-label-alist))
380 (setq column (max (if line (1+ (string-width line)) 0)
381 wl-plugged-queue-status-column))
383 ;; sending queue status
384 ((setq qinfo (assoc (cons server port) wl-plugged-sending-queue-alist))
387 (wl-set-string-width column line)
388 (wl-plugged-sending-queue-status qinfo))))
390 ((setq qinfo (assoc (list server port stream-type)
391 wl-plugged-dop-queue-alist))
394 (wl-set-string-width column line)
395 (wl-plugged-dop-queue-status qinfo column)))))
397 (setq alist (cdr alist)))
398 (delete-region (1- (point-max)) (point-max)) ;; delete line at the end.
399 (goto-char (point-min))
401 (wl-highlight-plugged-current-line)
403 (set-buffer-modified-p nil)
404 (count-lines (point-min) (point-max)))
406 (defun wl-plugged-redrawing-switch (indent switch &optional time)
408 (when (re-search-forward
409 (format "^%s\\[\\([^]]+\\)\\]" (make-string indent ? )))
410 (goto-char (match-beginning 1))
411 (delete-region (match-beginning 1) (match-end 1))
412 (insert (wl-plugged-string switch time))
413 (wl-highlight-plugged-current-line)
416 (defun wl-plugged-redrawing (plugged-alist)
417 (let ((buffer-read-only nil)
418 (alist plugged-alist)
419 last server port plugged time)
420 (goto-char (point-min))
421 (wl-plugged-redrawing-switch 0 (elmo-plugged-p))
423 (setq server (caaar alist)
425 plugged (nth 2 (car alist))
426 time (nth 3 (car alist)))
427 (unless (string= last server)
429 (wl-plugged-redrawing-switch
430 wl-plugged-server-indent
431 (elmo-plugged-p server nil plugged-alist))
434 (wl-plugged-redrawing-switch
435 wl-plugged-port-indent plugged time)
436 (setq alist (cdr alist))))
438 (set-buffer-modified-p nil))
440 (defun wl-plugged-change ()
442 (if (not elmo-plugged-alist)
443 (message "No plugged info")
444 (setq wl-plugged-winconf (current-window-configuration))
445 (let* ((cur-win (selected-window))
446 (max-lines (if (eq major-mode 'wl-summary-mode)
451 (set-buffer (get-buffer-create wl-plugged-buf-name))
453 (buffer-disable-undo (current-buffer))
454 (delete-windows-on (current-buffer))
455 (wl-plugged-set-variables)
456 (setq lines (wl-plugged-drawing wl-plugged-alist)))
457 (select-window cur-win)
458 (setq window-lines (min max-lines (max lines window-min-height)))
459 (when (> (- (window-height) window-lines) window-min-height)
460 (split-window cur-win (- (window-height) window-lines)))
461 (switch-to-buffer wl-plugged-buf-name)
464 (enlarge-window (- window-lines (window-height)))
465 (when (fboundp 'pos-visible-in-window-p)
466 (goto-char (point-min))
467 (while (and (< (window-height) max-lines)
468 (not (pos-visible-in-window-p (1- (point-max)))))
469 (enlarge-window 2))))
471 (goto-char (point-min))
473 (wl-plugged-move-to-next)))) ;; goto first entry
475 (defsubst wl-plugged-get-server ()
478 (wl-plugged-move-to-previous-server)
480 (when (looking-at (format "^%s\\[[^]]+\\]\\(.*\\)"
481 (wl-plugged-server-indent)))
482 (elmo-match-buffer 1))))
484 (defun wl-plugged-toggle ()
486 (let ((cur-point (point)))
492 (let (variable switch name)
493 (goto-char cur-point)
494 (when (and (not (bobp))
495 (not (eq (char-before) ? )))
496 (if (re-search-backward " [^ ]+" nil t)
498 (re-search-backward "^[^ ]+" nil t)))
499 (when (looking-at "\\([^ :[]+\\):?\\[\\([^]]+\\)\\]")
500 (setq name (elmo-match-buffer 1))
501 (setq switch (not (string= (elmo-match-buffer 2) wl-plugged-plug-on)))
502 (when (setq variable (cdr (assoc name wl-plugged-switch-variables)))
503 (set variable switch))
504 (goto-char (match-beginning 2))
505 (let ((buffer-read-only nil))
506 (delete-region (match-beginning 2) (match-end 2))
507 (insert (wl-plugged-string switch))
508 (set-buffer-modified-p nil)))))
510 ((looking-at "^\\( *\\)\\[\\([^]]+\\)\\]\\([^ \n]*\\)")
511 (let* ((indent (length (elmo-match-buffer 1)))
512 (switch (elmo-match-buffer 2))
513 (name (elmo-match-buffer 3))
514 (plugged (not (string= switch wl-plugged-plug-on)))
515 (alist wl-plugged-alist)
516 server port stream-type name-1)
518 ((eq indent wl-plugged-port-indent) ;; toggle port plug
520 ((string-match "\\([^([]*\\)(\\([^)[]+\\))" name)
521 (setq port (string-to-int (elmo-match-string 2 name)))
522 (if (string-match "!" (setq name-1 (elmo-match-string 1 name)))
524 (intern (substring name-1 (match-end 0))))))
527 (setq server (wl-plugged-get-server))
528 (elmo-set-plugged plugged server port stream-type nil alist))
529 ((eq indent wl-plugged-server-indent) ;; toggle server plug
530 (elmo-set-plugged plugged name nil nil nil alist))
531 ((eq indent 0) ;; toggle all plug
532 (elmo-set-plugged plugged nil nil nil nil alist)))
534 (wl-plugged-redrawing wl-plugged-alist)
535 ;; show plugged status in modeline
536 (let ((elmo-plugged wl-plugged-switch))
537 (setq wl-plugged-switch (elmo-plugged-p)
538 wl-modeline-plug-status wl-plugged-switch)
539 (force-mode-line-update t))))))
540 (setq wl-plugged-alist-modified t)
541 (goto-char cur-point)))
543 (defun wl-plugged-click (e)
548 (defun wl-plugged-toggle-all ()
550 (let ((cur-point (point)))
551 (setq wl-plugged-switch (not wl-plugged-switch))
552 (elmo-set-plugged wl-plugged-switch nil nil nil nil wl-plugged-alist)
553 (wl-plugged-redrawing wl-plugged-alist)
554 (goto-char cur-point)
555 (setq wl-plugged-alist-modified t)
556 ;; show plugged status in modeline
557 (setq wl-modeline-plug-status wl-plugged-switch)
558 (force-mode-line-update t)))
560 (defun wl-plugged-exit ()
562 (setq ;;elmo-plugged-alist wl-plugged-alist
563 wl-plugged wl-plugged-switch
565 wl-plugged-sending-queue-alist nil
566 wl-plugged-dop-queue-alist nil)
567 (run-hooks 'wl-plugged-exit-hook)
568 (when wl-plugged-alist-modified
569 (wl-toggle-plugged (if wl-plugged 'on 'off) t))
570 (kill-buffer (current-buffer))
571 (if wl-plugged-winconf
572 (set-window-configuration wl-plugged-winconf)))
574 (defun wl-plugged-flush-queue ()
576 (let ((cur-point (point))
577 (dop-status (elmo-dop-queue-flush))
578 (send-status (wl-draft-queue-flush)))
579 (unless (or dop-status send-status)
580 (message "No processing queue."))
581 (wl-plugged-set-variables)
582 (wl-plugged-drawing wl-plugged-alist)
583 (goto-char cur-point)))
585 (defun wl-plugged-move-to-next ()
587 (when (re-search-forward "\\[\\([^]]+\\)\\]" nil t)
588 (let ((pos (match-beginning 1)))
589 (if (invisible-p pos)
590 (goto-char (next-visible-point pos))
593 (defun wl-plugged-move-to-previous ()
595 (if (eq (char-before) ?\]) (forward-char -1))
596 (when (re-search-backward "\\[\\([^]]+\\)\\]" nil t)
597 (let ((pos (match-beginning 1)))
598 (if (invisible-p pos)
599 (goto-char (next-visible-point pos))
602 (defun wl-plugged-move-to-next-server ()
605 (format "^%s\\[\\([^]]+\\)\\]" (wl-plugged-server-indent)))
609 (if (re-search-forward regexp nil t)
610 (setq point (match-beginning 1))))
611 (if point (goto-char point))))
613 (defun wl-plugged-move-to-previous-server ()
616 (format "^%s\\[\\([^]]+\\)\\]" (wl-plugged-server-indent))))
617 (if (re-search-backward regexp nil t)
618 (goto-char (match-beginning 1)))))
620 ;;; end of wl-plugged-mode
623 "Save summary and folder status."
625 (wl-save-status 'keep-summary)
626 (run-hooks 'wl-save-hook))
628 (defun wl-save-status (&optional keep-summary)
629 (message "Saving summary and folder status...")
632 (let ((summaries (wl-collect-summary)))
634 (with-current-buffer (car summaries)
636 (wl-summary-cleanup-temp-marks))
637 (wl-summary-save-view keep-summary)
638 (elmo-folder-commit wl-summary-buffer-elmo-folder)
640 (kill-buffer (car summaries))))
641 (setq summaries (cdr summaries))))))
642 (wl-refile-alist-save)
643 (wl-folder-info-save)
644 (and (featurep 'wl-fldmgr) (wl-fldmgr-exit))
645 (elmo-crosspost-message-alist-save)
646 (message "Saving summary and folder status...done"))
650 (when (or (not wl-interactive-exit)
651 (y-or-n-p "Quit Wanderlust? "))
654 (run-hooks 'wl-exit-hook)
656 (wl-folder-cleanup-variables)
657 (wl-message-buffer-cache-clean-up)
661 (list wl-folder-buffer-name
664 (if (and wl-folder-use-frame
665 (> (length (visible-frame-list)) 1))
669 (remove-hook 'kill-emacs-hook 'wl-save-status))
671 (message "") ; empty minibuffer.
676 (unless (featurep 'mime-setup)
677 (require 'mime-setup))
678 (setq elmo-plugged wl-plugged)
680 (add-hook 'kill-emacs-hook 'wl-save-status))
683 (wl-refile-alist-setup)
687 (setq elmo-use-semi t))
689 (setq elmo-use-semi nil))
692 (fset 'wl-summary-from-func-internal
693 (symbol-value 'wl-summary-from-function))
694 (fset 'wl-summary-subject-func-internal
695 (symbol-value 'wl-summary-subject-function))
696 (fset 'wl-summary-subject-filter-func-internal
697 (symbol-value 'wl-summary-subject-filter-function))
698 (setq elmo-no-from wl-summary-no-from-message)
699 (setq elmo-no-subject wl-summary-no-subject-message)
701 ;; This hook may contain the functions `wl-plugged-init-icons' and
702 ;; `wl-biff-init-icons' for reasons of system internal to accord
703 ;; facilities for the Emacs variants.
704 (run-hooks 'wl-init-hook)))
706 (defun wl-check-environment (no-check-folder)
708 (error "Please set `wl-from'"))
710 (unless (string-match "[^.]\\.[^.]" (or wl-message-id-domain
712 (concat (system-name)
715 (error "Please set `wl-local-domain' to get valid FQDN"))
716 (if (string-match "@" (or wl-message-id-domain
718 (concat (system-name)
721 (error "Please remove `@' from `wl-message-id-domain'"))
722 (if (string= wl-local-domain "localdomain")
723 (error "Please set `wl-local-domain'"))
724 (if (string= wl-message-id-domain "localhost.localdomain")
725 (error "Please set `wl-message-id-domain'"))
727 (when (not no-check-folder)
728 (let ((draft-folder (wl-folder-get-elmo-folder wl-draft-folder))
729 (queue-folder (wl-folder-get-elmo-folder wl-queue-folder))
730 (trash-folder (wl-folder-get-elmo-folder wl-trash-folder))
731 (lost+found-folder (wl-folder-get-elmo-folder
732 elmo-lost+found-folder)))
733 (if (not (elmo-folder-message-file-p draft-folder))
734 (error "%s is not allowed for draft folder" wl-draft-folder))
735 (unless (elmo-folder-exists-p draft-folder)
737 (format "Draft Folder %s does not exist, create it? "
739 (elmo-folder-create draft-folder)
740 (error "Draft Folder is not created")))
741 (if (and wl-draft-enable-queuing
742 (not (elmo-folder-exists-p queue-folder)))
744 (format "Queue Folder %s does not exist, create it? "
746 (elmo-folder-create queue-folder)
747 (error "Queue Folder is not created")))
748 (when (not (eq no-check-folder 'wl-draft))
749 (unless (elmo-folder-exists-p trash-folder)
751 (format "Trash Folder %s does not exist, create it? "
753 (elmo-folder-create trash-folder)
754 (error "Trash Folder is not created")))
755 (unless (elmo-folder-exists-p lost+found-folder)
756 (elmo-folder-create lost+found-folder)))
758 (unless (file-exists-p wl-tmp-dir)
760 (format "Temp directory (to save multipart) %s does not exist, create it now? "
762 (make-directory wl-tmp-dir)
763 (error "Temp directory is not created"))))))
766 (defun wl (&optional arg)
767 "Start Wanderlust -- Yet Another Message Interface On Emacsen.
768 If ARG (prefix argument) is specified, folder checkings are skipped."
775 (if wl-demo (setq demo-buf (wl-demo))))
780 (message "Checking environment...")
781 (wl-check-environment arg)
782 (message "Checking environment...done"))
787 (wl-plugged-init (wl-folder arg))
789 (run-hooks 'wl-auto-check-folder-pre-hook)
790 (wl-folder-auto-check)
791 (run-hooks 'wl-auto-check-folder-hook))
792 (unless arg (wl-biff-start)))
794 (if (buffer-live-p demo-buf)
795 (kill-buffer demo-buf))
796 (signal (car obj)(cdr obj)))
798 (if (buffer-live-p demo-buf)
799 (kill-buffer demo-buf)))
800 (run-hooks 'wl-hook))
802 ;; Define some autoload functions WL might use.
804 ;; This little mapcar goes through the list below and marks the
805 ;; symbols in question as autoloaded functions.
809 (let ((interactive (nth 1 (memq ':interactive package))))
814 (when (consp function)
815 (setq keymap (car (memq 'keymap function)))
816 (setq function (car function)))
817 (autoload function (car package) nil interactive keymap))))
818 (if (eq (nth 1 package) ':interactive)
821 '(("wl-fldmgr" :interactive t
822 wl-fldmgr-access-display-all wl-fldmgr-access-display-normal
823 wl-fldmgr-add wl-fldmgr-clear-cut-entity-list wl-fldmgr-copy
824 wl-fldmgr-copy-region wl-fldmgr-cut wl-fldmgr-cut-region
825 wl-fldmgr-make-access-group wl-fldmgr-make-filter
826 wl-fldmgr-make-group wl-fldmgr-make-multi
827 wl-fldmgr-reconst-entity-hashtb wl-fldmgr-rename wl-fldmgr-delete
828 wl-fldmgr-save-folders wl-fldmgr-set-petname wl-fldmgr-sort
829 wl-fldmgr-subscribe wl-fldmgr-subscribe-region
830 wl-fldmgr-unsubscribe wl-fldmgr-unsubscribe-region wl-fldmgr-yank )
832 (wl-fldmgr-mode-map keymap)
833 wl-fldmgr-add-entity-hashtb)
834 ("wl-expire" :interactive t
835 wl-folder-archive-current-entity
836 wl-folder-expire-current-entity wl-summary-archive
839 wl-score-save wl-summary-rescore-msgs wl-summary-score-headers
840 wl-summary-score-update-all-lines )
841 ("wl-score" :interactive t
842 wl-score-change-score-file wl-score-edit-current-scores
843 wl-score-edit-file wl-score-flush-cache wl-summary-rescore
844 wl-score-set-mark-below wl-score-set-expunge-below
845 wl-summary-increase-score wl-summary-lower-score ))))
847 ;; for backward compatibility
848 (defalias 'wl-summary-from-func-petname 'wl-summary-default-from)
851 (product-provide (provide 'wl) (require 'wl-version))