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))))))
56 (provide 'wl) ; circular dependency
67 (require 'wl-highlight)
76 (defun wl-plugged-init (&optional make-alist)
77 (setq elmo-plugged wl-plugged)
78 (if wl-reset-plugged-alist
79 (elmo-set-plugged elmo-plugged))
81 (wl-make-plugged-alist))
83 (setq elmo-plugged (setq wl-plugged (elmo-plugged-p))
84 wl-modeline-plug-status wl-plugged)
86 (wl-toggle-plugged t 'flush)))
88 (defun wl-toggle-plugged (&optional arg queue-flush-only)
90 (elmo-quit) ; Disconnect current connection.
91 (unless queue-flush-only
96 (setq wl-plugged nil))
97 (t (setq wl-plugged (not wl-plugged))))
98 (elmo-set-plugged wl-plugged))
99 (setq elmo-plugged wl-plugged
100 wl-modeline-plug-status wl-plugged)
102 (let ((summaries (wl-collect-summary)))
104 (set-buffer (pop summaries))
105 (wl-summary-save-view)
106 (elmo-folder-commit wl-summary-buffer-elmo-folder))))
107 (setq wl-biff-check-folders-running nil)
111 (elmo-dop-queue-flush)
112 (unless queue-flush-only (wl-biff-start))
113 (if (and wl-draft-enable-queuing
115 (wl-draft-queue-flush))
116 ;; (when (and (eq major-mode 'wl-summary-mode)
117 ;; (elmo-folder-plugged-p wl-summary-buffer-elmo-folder))
118 ;; (let* ((msgdb-dir (elmo-folder-msgdb-path
119 ;; wl-summary-buffer-elmo-folder))
120 ;; (seen-list (elmo-msgdb-seen-load msgdb-dir)))
122 ;; (wl-summary-flush-pending-append-operations seen-list))
123 ;; (elmo-msgdb-seen-save msgdb-dir seen-list)))
124 (run-hooks 'wl-plugged-hook))
126 (run-hooks 'wl-unplugged-hook))
127 (force-mode-line-update t))
131 (defvar wl-plugged-port-label-alist
132 (list (cons 119 "nntp")
135 ;;(cons elmo-pop-before-smtp-port "pop3")
137 (defconst wl-plugged-switch-variables
138 '(("Queuing" . wl-draft-enable-queuing)
139 ("AutoFlushQueue" . wl-auto-flush-queue)
140 ("DisconnectedOperation" . elmo-enable-disconnected-operation)))
142 (defvar wl-plugged-buf-name "Plugged")
143 (defvar wl-plugged-mode-map nil)
144 (defvar wl-plugged-alist nil)
145 (defvar wl-plugged-switch nil)
146 (defvar wl-plugged-winconf nil)
147 (defvar wl-plugged-sending-queue-alist nil)
148 (defvar wl-plugged-dop-queue-alist nil)
149 (defvar wl-plugged-alist-modified nil)
151 (defvar wl-plugged-mode-menu-spec
153 ["Toggle plugged" wl-plugged-toggle t]
154 ["Toggle All plugged" wl-plugged-toggle-all t]
155 ["Prev Port" wl-plugged-move-to-previous t]
156 ["Next Port" wl-plugged-move-to-next t]
157 ["Prev Server" wl-plugged-move-to-previous-server t]
158 ["Next Server" wl-plugged-move-to-next-server t]
159 ["Flush queue" wl-plugged-flush-queue t]
161 ["Exit" wl-plugged-exit t]))
165 (defun wl-plugged-setup-mouse ()
166 (define-key wl-plugged-mode-map 'button2 'wl-plugged-click))
167 (defun wl-plugged-setup-mouse ()
168 (define-key wl-plugged-mode-map [mouse-2] 'wl-plugged-click))))
170 (unless wl-plugged-mode-map
171 (setq wl-plugged-mode-map (make-sparse-keymap))
172 (define-key wl-plugged-mode-map " " 'wl-plugged-toggle)
173 (define-key wl-plugged-mode-map "\C-m" 'wl-plugged-toggle)
174 (define-key wl-plugged-mode-map "\M-t" 'wl-plugged-toggle-all)
175 (define-key wl-plugged-mode-map "q" 'wl-plugged-exit)
176 (define-key wl-plugged-mode-map "\C-t" 'wl-plugged-exit)
177 (define-key wl-plugged-mode-map "F" 'wl-plugged-flush-queue)
178 (define-key wl-plugged-mode-map "P" 'wl-plugged-move-to-previous-server)
179 (define-key wl-plugged-mode-map "N" 'wl-plugged-move-to-next-server)
180 (define-key wl-plugged-mode-map "p" 'wl-plugged-move-to-previous)
181 (define-key wl-plugged-mode-map "n" 'wl-plugged-move-to-next)
182 (define-key wl-plugged-mode-map "\e\t" 'wl-plugged-move-to-previous)
183 (define-key wl-plugged-mode-map "\t" 'wl-plugged-move-to-next)
184 (wl-plugged-setup-mouse)
188 "Menu used in Plugged mode."
189 wl-plugged-mode-menu-spec))
191 (defun wl-plugged-mode ()
192 "Mode for setting Wanderlust plugged.
193 See info under Wanderlust for full documentation.
196 \\{wl-plugged-mode-map}
198 Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
200 (kill-all-local-variables)
201 (use-local-map wl-plugged-mode-map)
202 (setq major-mode 'wl-plugged-mode)
203 (setq mode-name "Plugged")
204 (easy-menu-add wl-plugged-mode-menu)
205 (wl-mode-line-buffer-identification)
206 (setq wl-plugged-switch wl-plugged)
207 (setq wl-plugged-alist-modified nil)
208 (setq buffer-read-only t)
209 (run-hooks 'wl-plugged-mode-hook))
211 (defmacro wl-plugged-string (plugged &optional time)
212 (` (if (, time) wl-plugged-auto-off
213 (if (, plugged) wl-plugged-plug-on wl-plugged-plug-off))))
215 (defmacro wl-plugged-server-indent ()
216 (` (make-string wl-plugged-server-indent ? )))
218 (defun wl-plugged-set-variables ()
219 (setq wl-plugged-sending-queue-alist
220 (wl-plugged-sending-queue-info))
221 (setq wl-plugged-dop-queue-alist
222 (wl-plugged-dop-queue-info))
223 (setq wl-plugged-alist
224 (sort (copy-sequence elmo-plugged-alist)
226 (string< (caar a) (caar b))))))
228 (defun wl-plugged-sending-queue-info ()
229 ;; sending queue status
230 (let (alist msgs sent-via server port)
231 (setq msgs (elmo-folder-list-messages
232 (wl-folder-get-elmo-folder wl-queue-folder)))
234 (setq sent-via (wl-draft-queue-info-operation (car msgs) 'get-sent-via))
236 (when (eq (nth 1 (car sent-via)) 'unplugged)
237 (setq server (car (nth 2 (car sent-via)))
238 port (cdr (nth 2 (car sent-via))))
239 (elmo-plugged-p server port) ;; add elmo-plugged-alist if nothing.
241 (wl-append-assoc-list
245 (setq sent-via (cdr sent-via)))
246 (setq msgs (cdr msgs)))
249 (defun wl-plugged-sending-queue-status (qinfo)
250 ;; sending queue status
251 (let ((len (length (cdr qinfo))))
252 (concat (wl-plugged-set-folder-icon
254 (wl-folder-get-petname wl-queue-folder))
256 (format ": %d msgs (" len)
257 (format ": %d msg (" len))
258 (mapconcat (function int-to-string) (cdr qinfo) ",")
261 (defun wl-plugged-dop-queue-info ()
264 (elmo-dop-queue (copy-sequence elmo-dop-queue))
265 dop-queue last alist server-info
267 ;(elmo-dop-queue-load)
268 (elmo-dop-queue-merge)
269 (setq dop-queue (sort elmo-dop-queue '(lambda (a b)
270 (string< (elmo-dop-queue-fname a)
271 (elmo-dop-queue-fname b)))))
272 (wl-append dop-queue (list nil)) ;; terminate(dummy)
273 (when (car dop-queue)
274 (setq last (elmo-dop-queue-fname (car dop-queue)))) ;; first
276 (when (car dop-queue)
277 (setq ope (cons (elmo-dop-queue-method-name (car dop-queue))
281 (elmo-dop-queue-arguments (car dop-queue))))
282 (car (elmo-dop-queue-arguments
283 (car dop-queue))))))))
284 (if (and (car dop-queue)
285 (string= last (elmo-dop-queue-fname (car dop-queue))))
286 (wl-append operation (list ope))
287 ;;(setq count (1+ count))
288 (when (and last (setq server-info (elmo-net-port-info
289 (wl-folder-get-elmo-folder last))))
291 (wl-append-assoc-list
293 (cons last operation)
295 (when (car dop-queue)
296 (setq last (elmo-dop-queue-fname (car dop-queue))
297 operation (list ope))))
298 (setq dop-queue (cdr dop-queue)))
301 (defun wl-plugged-dop-queue-status (qinfo &optional column)
303 (let ((operations (cdr qinfo))
304 (column (or column wl-plugged-queue-status-column)))
306 '(lambda (folder-ope)
307 (concat (wl-plugged-set-folder-icon
309 (wl-folder-get-petname (car folder-ope)))
311 (let ((opes (cdr folder-ope))
314 (if (setq pair (assoc (car (car opes)) shrinked))
315 (setcdr pair (+ (cdr pair)
316 (max (cdr (car opes)) 1)))
318 (cons (car (car opes))
319 (max (cdr (car opes)) 1))
321 (setq opes (cdr opes)))
325 (format "%s:%d" (car ope) (cdr ope))
326 (format "%s" (car ope))))
327 (nreverse shrinked) ","))
330 (concat "\n" (wl-set-string-width column "")))))
332 (defun wl-plugged-drawing (plugged-alist)
333 (let ((buffer-read-only nil)
334 (alist plugged-alist)
335 (vars wl-plugged-switch-variables)
336 last server port stream-type label plugged time
337 line len qinfo column)
340 (insert (format "%s:[%s]%s"
342 (wl-plugged-string (symbol-value (cdar vars)))
343 (if (cdr vars) " " "")))
344 (setq vars (cdr vars)))
346 (let ((elmo-plugged wl-plugged-switch))
347 (setq line (format "[%s](wl-plugged)"
348 (wl-plugged-string (elmo-plugged-p))))
349 ;; sending queue status
350 (when (setq qinfo (assoc (cons nil nil) wl-plugged-sending-queue-alist))
352 (wl-set-string-width wl-plugged-queue-status-column line)
353 (wl-plugged-sending-queue-status qinfo))))
356 (setq server (nth 0 (caar alist))
357 port (nth 1 (caar alist))
358 stream-type (nth 2 (caar alist))
359 label (nth 1 (car alist))
360 plugged (nth 2 (car alist))
361 time (nth 3 (car alist)))
362 (unless (string= last server)
364 (insert (format "%s[%s]%s\n"
365 (wl-plugged-server-indent)
367 (elmo-plugged-p server nil plugged-alist))
373 (make-string wl-plugged-port-indent ? )
374 (wl-plugged-string plugged time)
381 (cdr (assq port wl-plugged-port-label-alist))
384 (setq column (max (if line (1+ (string-width line)) 0)
385 wl-plugged-queue-status-column))
387 ;; sending queue status
388 ((setq qinfo (assoc (cons server port) wl-plugged-sending-queue-alist))
391 (wl-set-string-width column line)
392 (wl-plugged-sending-queue-status qinfo))))
394 ((setq qinfo (assoc (list server port stream-type)
395 wl-plugged-dop-queue-alist))
398 (wl-set-string-width column line)
399 (wl-plugged-dop-queue-status qinfo column)))))
401 (setq alist (cdr alist)))
402 (delete-region (1- (point-max)) (point-max)) ;; delete line at the end.
403 (goto-char (point-min))
405 (wl-highlight-plugged-current-line)
407 (set-buffer-modified-p nil)
408 (count-lines (point-min) (point-max)))
410 (defun wl-plugged-redrawing-switch (indent switch &optional time)
412 (when (re-search-forward
413 (format "^%s\\[\\([^]]+\\)\\]" (make-string indent ? )))
414 (goto-char (match-beginning 1))
415 (delete-region (match-beginning 1) (match-end 1))
416 (insert (wl-plugged-string switch time))
417 (wl-highlight-plugged-current-line)
420 (defun wl-plugged-redrawing (plugged-alist)
421 (let ((buffer-read-only nil)
422 (alist plugged-alist)
423 last server port plugged time)
424 (goto-char (point-min))
425 (wl-plugged-redrawing-switch 0 (elmo-plugged-p))
427 (setq server (caaar alist)
429 plugged (nth 2 (car alist))
430 time (nth 3 (car alist)))
431 (unless (string= last server)
433 (wl-plugged-redrawing-switch
434 wl-plugged-server-indent
435 (elmo-plugged-p server nil plugged-alist))
438 (wl-plugged-redrawing-switch
439 wl-plugged-port-indent plugged time)
440 (setq alist (cdr alist))))
442 (set-buffer-modified-p nil))
444 (defun wl-plugged-change ()
446 (if (not elmo-plugged-alist)
447 (message "No plugged info")
448 (setq wl-plugged-winconf (current-window-configuration))
449 (let* ((cur-win (selected-window))
450 (max-lines (if (eq major-mode 'wl-summary-mode)
455 (set-buffer (get-buffer-create wl-plugged-buf-name))
457 (buffer-disable-undo (current-buffer))
458 (delete-windows-on (current-buffer))
459 (wl-plugged-set-variables)
460 (setq lines (wl-plugged-drawing wl-plugged-alist)))
461 (select-window cur-win)
462 (setq window-lines (min max-lines (max lines window-min-height)))
463 (when (> (- (window-height) window-lines) window-min-height)
464 (split-window cur-win (- (window-height) window-lines)))
465 (switch-to-buffer wl-plugged-buf-name)
468 (enlarge-window (- window-lines (window-height)))
469 (when (fboundp 'pos-visible-in-window-p)
470 (goto-char (point-min))
471 (while (and (< (window-height) max-lines)
472 (not (pos-visible-in-window-p (1- (point-max)))))
473 (enlarge-window 2))))
475 (goto-char (point-min))
477 (wl-plugged-move-to-next)))) ;; goto first entry
479 (defsubst wl-plugged-get-server ()
482 (wl-plugged-move-to-previous-server)
484 (when (looking-at (format "^%s\\[[^]]+\\]\\(.*\\)"
485 (wl-plugged-server-indent)))
486 (elmo-match-buffer 1))))
488 (defun wl-plugged-toggle ()
490 (let ((cur-point (point)))
496 (let (variable switch name)
497 (goto-char cur-point)
498 (when (and (not (bobp))
499 (not (eq (char-before) ? )))
500 (if (re-search-backward " [^ ]+" nil t)
502 (re-search-backward "^[^ ]+" nil t)))
503 (when (looking-at "\\([^ :[]+\\):?\\[\\([^]]+\\)\\]")
504 (setq name (elmo-match-buffer 1))
505 (setq switch (not (string= (elmo-match-buffer 2) wl-plugged-plug-on)))
506 (when (setq variable (cdr (assoc name wl-plugged-switch-variables)))
507 (set variable switch))
508 (goto-char (match-beginning 2))
509 (let ((buffer-read-only nil))
510 (delete-region (match-beginning 2) (match-end 2))
511 (insert (wl-plugged-string switch))
512 (set-buffer-modified-p nil)))))
514 ((looking-at "^\\( *\\)\\[\\([^]]+\\)\\]\\([^ \n]*\\)")
515 (let* ((indent (length (elmo-match-buffer 1)))
516 (switch (elmo-match-buffer 2))
517 (name (elmo-match-buffer 3))
518 (plugged (not (string= switch wl-plugged-plug-on)))
519 (alist wl-plugged-alist)
520 server port stream-type name-1)
522 ((eq indent wl-plugged-port-indent) ;; toggle port plug
524 ((string-match "\\([^([]*\\)(\\([^)[]+\\))" name)
525 (setq port (string-to-int (elmo-match-string 2 name)))
526 (if (string-match "!" (setq name-1 (elmo-match-string 1 name)))
528 (intern (substring name-1 (match-end 0))))))
531 (setq server (wl-plugged-get-server))
532 (elmo-set-plugged plugged server port stream-type nil alist))
533 ((eq indent wl-plugged-server-indent) ;; toggle server plug
534 (elmo-set-plugged plugged name nil nil nil alist))
535 ((eq indent 0) ;; toggle all plug
536 (elmo-set-plugged plugged nil nil nil nil alist)))
538 (wl-plugged-redrawing wl-plugged-alist)
539 ;; show plugged status in modeline
540 (let ((elmo-plugged wl-plugged-switch))
541 (setq wl-plugged-switch (elmo-plugged-p)
542 wl-modeline-plug-status wl-plugged-switch)
543 (force-mode-line-update t))))))
544 (setq wl-plugged-alist-modified t)
545 (goto-char cur-point)))
547 (defun wl-plugged-click (e)
552 (defun wl-plugged-toggle-all ()
554 (let ((cur-point (point)))
555 (setq wl-plugged-switch (not wl-plugged-switch))
556 (elmo-set-plugged wl-plugged-switch nil nil nil nil wl-plugged-alist)
557 (wl-plugged-redrawing wl-plugged-alist)
558 (goto-char cur-point)
559 (setq wl-plugged-alist-modified t)
560 ;; show plugged status in modeline
561 (setq wl-modeline-plug-status wl-plugged-switch)
562 (force-mode-line-update t)))
564 (defun wl-plugged-exit ()
566 (setq ;;elmo-plugged-alist wl-plugged-alist
567 wl-plugged wl-plugged-switch
569 wl-plugged-sending-queue-alist nil
570 wl-plugged-dop-queue-alist nil)
571 (run-hooks 'wl-plugged-exit-hook)
572 (when wl-plugged-alist-modified
573 (wl-toggle-plugged (if wl-plugged 'on 'off) t))
574 (kill-buffer (current-buffer))
575 (if wl-plugged-winconf
576 (set-window-configuration wl-plugged-winconf)))
578 (defun wl-plugged-flush-queue ()
580 (let ((cur-point (point))
581 (dop-status (elmo-dop-queue-flush))
582 (send-status (wl-draft-queue-flush)))
583 (unless (or dop-status send-status)
584 (message "No processing queue."))
585 (wl-plugged-set-variables)
586 (wl-plugged-drawing wl-plugged-alist)
587 (goto-char cur-point)))
589 (defun wl-plugged-move-to-next ()
591 (when (re-search-forward "\\[\\([^]]+\\)\\]" nil t)
592 (let ((pos (match-beginning 1)))
593 (if (invisible-p pos)
594 (goto-char (next-visible-point pos))
597 (defun wl-plugged-move-to-previous ()
599 (if (eq (char-before) ?\]) (forward-char -1))
600 (when (re-search-backward "\\[\\([^]]+\\)\\]" nil t)
601 (let ((pos (match-beginning 1)))
602 (if (invisible-p pos)
603 (goto-char (next-visible-point pos))
606 (defun wl-plugged-move-to-next-server ()
609 (format "^%s\\[\\([^]]+\\)\\]" (wl-plugged-server-indent)))
613 (if (re-search-forward regexp nil t)
614 (setq point (match-beginning 1))))
615 (if point (goto-char point))))
617 (defun wl-plugged-move-to-previous-server ()
620 (format "^%s\\[\\([^]]+\\)\\]" (wl-plugged-server-indent))))
621 (if (re-search-backward regexp nil t)
622 (goto-char (match-beginning 1)))))
624 ;;; end of wl-plugged-mode
627 "Save summary and folder status."
629 (wl-save-status 'keep-summary)
630 (run-hooks 'wl-save-hook))
632 (defun wl-save-status (&optional keep-summary)
633 (message "Saving summary and folder status...")
636 (let ((summaries (wl-collect-summary)))
638 (with-current-buffer (car summaries)
640 (wl-summary-cleanup-temp-marks))
641 (wl-summary-save-view)
642 (elmo-folder-commit wl-summary-buffer-elmo-folder)
644 (kill-buffer (car summaries))))
645 (setq summaries (cdr summaries))))))
646 (wl-refile-alist-save)
647 (wl-folder-info-save)
648 (and (featurep 'wl-fldmgr) (wl-fldmgr-exit))
649 (elmo-crosspost-message-alist-save)
650 (message "Saving summary and folder status...done"))
654 (when (or (not wl-interactive-exit)
655 (y-or-n-p "Do you really want to quit Wanderlust? "))
657 (when wl-use-acap (funcall (symbol-function 'wl-acap-exit)))
659 (run-hooks 'wl-exit-hook)
661 (wl-folder-cleanup-variables)
662 (wl-message-buffer-cache-clean-up)
666 (list wl-folder-buffer-name
669 (if (and wl-folder-use-frame
670 (> (length (visible-frame-list)) 1))
673 (remove-hook 'kill-emacs-hook 'wl-save-status)
675 (message "") ; empty minibuffer.
680 (require 'mime-setup)
681 (setq elmo-plugged wl-plugged)
682 (add-hook 'kill-emacs-hook 'wl-save-status)
685 (wl-refile-alist-setup)
689 (fset 'wl-summary-from-func-internal
690 (symbol-value 'wl-summary-from-function))
691 (fset 'wl-summary-subject-func-internal
692 (symbol-value 'wl-summary-subject-function))
693 (fset 'wl-summary-subject-filter-func-internal
694 (symbol-value 'wl-summary-subject-filter-function))
695 (setq elmo-no-from wl-summary-no-from-message)
696 (setq elmo-no-subject wl-summary-no-subject-message)
698 ;; This hook may contain the functions `wl-plugged-init-icons' and
699 ;; `wl-biff-init-icons' for reasons of system internal to accord
700 ;; facilities for the Emacs variants.
701 (run-hooks 'wl-init-hook)))
703 (defun wl-check-environment (no-check-folder)
704 (unless wl-from (error "Please set `wl-from'"))
706 (unless (string-match "[^.]\\.[^.]" (or wl-message-id-domain
708 (concat (system-name)
711 (error "Please set `wl-local-domain' to get valid FQDN"))
712 (if (string-match "@" (or wl-message-id-domain
714 (concat (system-name)
717 (error "Please remove `@' from `wl-message-id-domain'"))
718 (if (string= wl-local-domain "localdomain")
719 (error "Please set `wl-local-domain'"))
720 (if (string= wl-message-id-domain "localhost.localdomain")
721 (error "Please set `wl-message-id-domain'"))
723 (when (not no-check-folder)
724 (let ((draft-folder (wl-folder-get-elmo-folder wl-draft-folder))
725 (queue-folder (wl-folder-get-elmo-folder wl-queue-folder))
726 (trash-folder (wl-folder-get-elmo-folder wl-trash-folder))
727 (lost+found-folder (wl-folder-get-elmo-folder
728 elmo-lost+found-folder)))
729 (if (not (elmo-folder-message-file-p draft-folder))
730 (error "%s is not allowed for draft folder" wl-draft-folder))
731 (unless (elmo-folder-exists-p draft-folder)
733 (format "Draft Folder %s does not exist, create it? "
735 (elmo-folder-create draft-folder)
736 (error "Draft Folder is not created")))
737 (if (and wl-draft-enable-queuing
738 (not (elmo-folder-exists-p queue-folder)))
740 (format "Queue Folder %s does not exist, create it? "
742 (elmo-folder-create queue-folder)
743 (error "Queue Folder is not created")))
744 (when (not (eq no-check-folder 'wl-draft))
745 (unless (elmo-folder-exists-p trash-folder)
747 (format "Trash Folder %s does not exist, create it? "
749 (elmo-folder-create trash-folder)
750 (error "Trash Folder is not created")))
751 (unless (elmo-folder-exists-p lost+found-folder)
752 (elmo-folder-create lost+found-folder)))
754 (unless (file-exists-p wl-temporary-file-directory)
756 (format "Temp directory (to save multipart) %s does not exist, create it now? "
757 wl-temporary-file-directory))
758 (make-directory wl-temporary-file-directory)
759 (error "Temp directory is not created"))))))
762 (defun wl (&optional arg)
763 "Start Wanderlust -- Yet Another Message Interface On Emacsen.
764 If ARG (prefix argument) is specified, folder checkings are skipped."
770 (let (demo-buf check)
772 (if wl-demo (setq demo-buf (wl-demo)))
780 (message "Checking environment...")
781 (wl-check-environment arg)
782 (message "Checking environment...done"))
785 (wl-plugged-init (wl-folder arg))
787 (run-hooks 'wl-auto-check-folder-pre-hook)
788 (wl-folder-auto-check)
789 (run-hooks 'wl-auto-check-folder-hook))
790 (unless arg (wl-biff-start)))
792 (if (buffer-live-p demo-buf)
793 (kill-buffer demo-buf))
794 (signal (car obj)(cdr obj)))
796 (if (buffer-live-p demo-buf)
797 (kill-buffer demo-buf)))
798 (run-hooks 'wl-hook))
800 ;; Define some autoload functions WL might use.
802 ;; This little mapcar goes through the list below and marks the
803 ;; symbols in question as autoloaded functions.
807 (let ((interactive (nth 1 (memq ':interactive package))))
812 (when (consp function)
813 (setq keymap (car (memq 'keymap function)))
814 (setq function (car function)))
815 (autoload function (car package) nil interactive keymap))))
816 (if (eq (nth 1 package) ':interactive)
819 '(("wl-fldmgr" :interactive t
820 wl-fldmgr-access-display-all wl-fldmgr-access-display-normal
821 wl-fldmgr-add wl-fldmgr-clear-cut-entity-list wl-fldmgr-copy
822 wl-fldmgr-copy-region wl-fldmgr-cut wl-fldmgr-cut-region
823 wl-fldmgr-make-access-group wl-fldmgr-make-filter
824 wl-fldmgr-make-group wl-fldmgr-make-multi
825 wl-fldmgr-reconst-entity-hashtb wl-fldmgr-rename wl-fldmgr-delete
826 wl-fldmgr-save-folders wl-fldmgr-set-petname wl-fldmgr-sort
827 wl-fldmgr-subscribe wl-fldmgr-subscribe-region
828 wl-fldmgr-unsubscribe wl-fldmgr-unsubscribe-region wl-fldmgr-yank )
829 ("wl-acap" wl-acap-init)
830 ("wl-acap" :interactive t wl-acap-store)
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))