Synch with wl-2_4.
[elisp/wanderlust.git] / samples / en / dot.wl
1 ;;;                                                     -*- emacs-lisp -*-
2 ;;; ~/.wl (setting file for Wanderlust)
3 ;;;                                             Last-Modified: 1999-11-07
4 ;;;
5
6 ;; Following must be included in ~/.emacs
7 ;; for .emacs begin
8 (require 'mime-setup)
9 (autoload 'wl "wl" "Wanderlust" t)
10 (autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t)
11 ;; for .emacs end
12
13 ;;; [[ Private Setting ]]
14
15 ;; Header From 
16 ;(setq wl-from "Your Name <e-mail-address>")
17 ;; Organization
18 ;(setq wl-organization "")
19
20 ;;; [[ Basic Setting ]]
21
22 ;; A directory for message database.
23 (setq elmo-msgdb-dir "~/.elmo")
24
25 ;; Home directory for MH (localdir) 
26 (setq elmo-localdir-folder-path "~/Mail")
27 ;; Default IMAP4 server
28 (setq elmo-default-imap4-server "localhost")
29 ;; Default POP server
30 (setq elmo-default-pop3-server "localhost")
31 ;; Default NNTP server
32 (setq elmo-default-nntp-server "localhost")
33 ;; NNTP server name for posting
34 (setq wl-nntp-posting-server elmo-default-nntp-server)
35 ;; SMTP server
36 (setq wl-smtp-posting-server "localhost")
37
38 ;; Icon directory (XEmacs)
39 ;; (No need if installed as XEmacs package.)
40 ;(setq wl-icon-dir "~/work/wl/etc")
41
42 ;; If (system-name) does not return FQDN,
43 ;; set following as a local domain name without hostname.
44 ;; ((system-name) "." wl-local-domain is used as domain part of Message-ID
45 ;; and an argument of HELO in SMTP.
46 ;(setq wl-local-domain "localdomain")
47 ;; Specific domain part for message-id.
48 ;(setq wl-message-id-domain "localhost.localdomain")
49
50 ;(setq wl-default-folder "+inbox")   ;; Default folder for 
51                                      ;; wl-summary-goto-folder.
52 ;(setq wl-default-spec "+")          ;; Default string for 
53                                      ;; folder name completion.
54
55 ;(setq wl-fcc "+outbox")             ;; Folder Carbon Copy
56
57 (setq wl-interactive-exit t)         ;; Confirm at exit time.
58 (setq wl-interactive-send t)         ;; Confirm at message sending time.
59
60 (setq wl-auto-select-first t)        ;; display first message automatically.
61 (setq wl-auto-select-next t)         ;; goto next folder when exit from 
62                                      ;; summary.
63 ;(setq wl-summary-next-no-unread 'skip-no-unread)  
64                                      ;; folder is skipped if there is no 
65                                      ;; unread.
66
67 (setq wl-summary-move-order 'unread) ;; jump to unread message in 'N' or 'P'.
68 (setq wl-thread-insert-opened t)     ;; Create opened thread.
69
70 ;(setq wl-stay-folder-window t)      ;; folder mode and summary mode is
71                                      ;; displayed at the same time.
72
73 ;; cache setting.
74 ;; (messages in localdir, localnews, maildir are not cached.)
75 ;(setq elmo-archive-use-cache nil)
76 ;(setq elmo-nntp-use-cache nil)
77 ;(setq elmo-imap4-use-cache t)
78 ;(setq elmo-pop3-use-cache t)
79
80 ;; Enable disconnected operation in IMAP folder.
81 ;(setq elmo-enable-disconnected-operation t)
82
83 ;; Store draft message in queue folder if message is sent in unplugged status.
84 (setq wl-draft-enable-queuing t)
85 ;; when plug status is changed from unplugged to plugged, 
86 ;; queued message is flushed automatically.
87 (setq wl-auto-flush-queue t)
88
89 ;; offline at startup.
90 ;(setq wl-plugged nil)
91 ;; change plug status by server or port at startup.
92 ;(add-hook 'wl-make-plugged-hook
93 ;         '(lambda ()
94 ;            (elmo-set-plugged plugged(t/nil) server port)
95 ;            (elmo-set-plugged plugged(t/nil) server)
96 ;            ))
97
98
99 ;; highlight setting (for light background)
100
101 ;; decide group folder color by number.
102 ;(setq wl-highlight-group-folder-by-numbers nil)
103
104 (setq wl-highlight-message-header-alist
105       '(("Subject[ \t]*:" . wl-highlight-message-subject-header-contents)
106         ("From[ \t]*:" . wl-highlight-message-from-header-contents)
107         ("\\(.*To\\|Cc\\|Newsgroups\\)[ \t]*:" . wl-highlight-message-important-header-contents)
108         ("\\(User-Agent\\|X-Mailer\\|X-Newsreader\\)[ \t]*:" .
109          wl-highlight-message-unimportant-header-contents)
110         ))
111 ;; don't change color by citation level.
112 ;(setq wl-highlight-citation-face-list
113 ;      '(wl-highlight-message-cited-text-1))
114
115 (defun my-wl-set-face (face spec)
116   (make-face face)
117   (cond ((fboundp 'face-spec-set)
118          (face-spec-set face spec))
119         (t
120          (wl-declare-face face spec))))
121
122 ;; header.
123 (my-wl-set-face 'wl-highlight-message-subject-header-contents
124                 '((t (:foreground "blue" :bold t))))
125 (my-wl-set-face 'wl-highlight-message-from-header-contents
126                 '((t (:foreground "red" :bold t))))
127 (my-wl-set-face 'wl-highlight-message-important-header-contents
128                 '((t (:foreground "purple" :bold t))))
129 (my-wl-set-face 'wl-highlight-message-unimportant-header-contents
130                 '((t (:foreground "RoyalBlue" :bold t))))
131 (my-wl-set-face 'wl-highlight-message-headers
132                 '((t (:foreground "magenta3" :bold t))))
133 (my-wl-set-face 'wl-highlight-message-header-contents
134                 '((t (:foreground "brown" :bold nil))))
135 (my-wl-set-face 'wl-highlight-message-signature
136                 '((t (:foreground "blue"))))
137 ;; citation.
138 (my-wl-set-face 'wl-highlight-message-citation-header
139                 '((t (:foreground "DarkGreen"))))
140 (my-wl-set-face 'wl-highlight-message-cited-text-1
141                 '((t (:foreground "forest green"))))
142 (my-wl-set-face 'wl-highlight-message-cited-text-2
143                 '((t (:foreground "SaddleBrown"))))
144 (my-wl-set-face 'wl-highlight-message-cited-text-3
145                 '((t (:foreground "orchid3"))))
146 (my-wl-set-face 'wl-highlight-message-cited-text-4
147                 '((t (:foreground "purple1"))))
148 (my-wl-set-face 'wl-highlight-message-cited-text-5
149                 '((t (:foreground "MediumPurple1"))))
150 (my-wl-set-face 'wl-highlight-message-cited-text-6
151                 '((t (:foreground "PaleVioletRed"))))
152 (my-wl-set-face 'wl-highlight-message-cited-text-7
153                 '((t (:foreground "LightPink"))))
154 (my-wl-set-face 'wl-highlight-message-cited-text-8
155                 '((t (:foreground "salmon"))))
156 (my-wl-set-face 'wl-highlight-message-cited-text-9
157                 '((t (:foreground "SandyBrown"))))
158 (my-wl-set-face 'wl-highlight-message-cited-text-10
159                 '((t (:foreground "wheat"))))
160 ;; summary.
161 (my-wl-set-face 'wl-highlight-summary-important-face
162                 '((t (:foreground "purple"))))
163 (my-wl-set-face 'wl-highlight-summary-new-face
164                 '((t (:foreground "tomato"))))
165 (my-wl-set-face 'wl-highlight-summary-unread-face
166                 '((t (:foreground "RoyalBlue"))))
167 (my-wl-set-face 'wl-highlight-summary-deleted-face
168                 '((t (:foreground "gray"))))
169 (my-wl-set-face 'wl-highlight-summary-refiled-face
170                 '((t (:foreground "blue"))))
171 (my-wl-set-face 'wl-highlight-summary-temp-face
172                 '((t (:foreground "salmon"))))
173 (my-wl-set-face 'wl-highlight-summary-displaying-face
174                 '((t (:bold t :underline t))))
175 ;; (thread)
176 (my-wl-set-face 'wl-highlight-summary-thread-top-face
177                 '((t (:foreground "green4"))))
178 (my-wl-set-face 'wl-highlight-summary-normal-face
179                 '((t (:foreground "SeaGreen"))))
180 ;; folder
181 (my-wl-set-face 'wl-highlight-folder-unknown-face
182                 '((t (:foreground "RoyalBlue"))))
183 (my-wl-set-face 'wl-highlight-folder-killed-face
184                 '((t (:foreground "gray50"))))
185 (my-wl-set-face 'wl-highlight-folder-unread-face
186                 '((t (:foreground "brown"))))
187 (my-wl-set-face 'wl-highlight-folder-zero-face
188                 '((t (:foreground "blue4"))))
189 (my-wl-set-face 'wl-highlight-folder-few-face
190                 '((t (:foreground "tomato"))))
191 (my-wl-set-face 'wl-highlight-folder-many-face
192                 '((t (:foreground "HotPink1"))))
193 ;; group
194 (my-wl-set-face 'wl-highlight-folder-opened-face
195                 '((t (:foreground "forest green"))))
196 (my-wl-set-face 'wl-highlight-folder-closed-face
197                 '((t (:foreground "DarkOliveGreen4"))))
198 ;; demo
199 (my-wl-set-face 'wl-highlight-demo-face
200                 '((t (:foreground "blue2"))))
201
202
203 ;;; [[ Special Setting ]]
204
205 ;; compress ~/elmo  using jka-compr.
206 ;(setq elmo-msgdb-overview-filename "overview.gz")
207 ;(setq elmo-msgdb-number-filename "number.gz")
208 ;(setq wl-summary-cache-file ".wl-summary-cache.gz")
209 ;(setq wl-thread-top-file ".wl-thread-top.gz")
210
211
212 ;; open unread group folder after checking.
213 (add-hook 'wl-folder-check-entity-hook
214           '(lambda ()
215              (wl-folder-open-unread-folder entity)
216              ))
217
218 ;; User's mail addresses.
219 (setq wl-user-mail-address-list
220       (list (wl-address-header-extract-address wl-from)
221             ;;"e-mail2@bbb.com" ...
222             ))
223
224 ;; Subscribed mailing list
225 (setq wl-subscribed-mailing-list
226       '("wl@lists.airs.net"
227         "apel-ja@m17n.org"
228         ;;"ml@example.com" ...
229         ))
230
231 ;; Change summary display function.
232
233 ;; get extra field values as overview information (only localdir folder).
234 (setq elmo-msgdb-extra-fields '("newsgroups"
235                                 "x-ml-name"
236                                 "x-mail-count" "x-ml-count"
237                                 "x-sequence"
238                                 "mailing-list"))
239
240 ;;; ML message displays ML name and ML sequence number in subject.
241 (setq wl-summary-subject-func 'my-wl-summary-subject-func-ml)
242 (defun my-wl-summary-subject-func-ml (subject-string)
243   (let ((folder wl-summary-buffer-folder-name)
244         (subj subject-string) (sequence) (ml-name) (ml-count))
245     (setq sequence (elmo-msgdb-overview-entity-get-extra-field
246                     entity "x-sequence")
247           ml-name (or (elmo-msgdb-overview-entity-get-extra-field
248                        entity "x-ml-name")
249                       (and sequence
250                            (car (split-string sequence " "))))
251           ml-count (or (elmo-msgdb-overview-entity-get-extra-field
252                         entity "x-mail-count")
253                        (elmo-msgdb-overview-entity-get-extra-field
254                         entity "x-ml-count")
255                        (and sequence
256                             (cadr (split-string sequence " ")))))
257     (if (string-match
258          "^\\s(\\(.+\\)[ :]\\([0-9]+\\)\\s)[ \t]*"
259          subject-string)
260         (progn
261           (setq subj (substring subject-string (match-end 0)))
262           (if (not ml-name) (setq ml-name (match-string 1 subject-string)))
263           (if (not ml-count) (setq ml-count (match-string 2 subject-string)))))
264     (if (and ml-name ml-count)
265         (if (string= folder wl-default-folder)
266             (format "(%s %05d) %s"
267                     (car (split-string ml-name " "))
268                     (string-to-int ml-count)
269                     subj)
270           (format "#%05d %s"
271                   (string-to-int ml-count) subj))
272       subj)))
273
274 ;; imput asynchronously.
275 ;; (utils/im-wl.el is needed to be installed.
276 ;;  Don't forget setting ~/.im/Config (Smtpservers).
277 ;;  note that wl-draft-enable-queuing is not valid.)
278 ;(autoload 'wl-draft-send-with-imput-async "im-wl")
279 ;(setq wl-draft-send-func 'wl-draft-send-with-imput-async)
280
281
282 ;; template
283 (setq wl-template-alist
284       '(("default"
285          ("From" . wl-from)
286          ("Organization" . "~/.wl sample")
287          (body . "Hello, this is XXX \n"))              ;; body
288         ("report"
289          ("To" . "boss@company.jp")
290          ("Subject" . "Report")
291          (top . "Sir, here is my report\n")             ;; insert in top.
292 ;;       (file-bottom . "~/work/report.txt")    ;; insert file in bottom
293          )
294         ))
295 ;; Change headers in draft sending time.
296 (setq wl-draft-config-alist
297       '((reply          ;; see reply buffer
298          "^To: .*\\(test-notsend-wl@lists.airs.net\\)"
299          (template . "default"))                ;; template
300         ("^To: .*\\(test-notsend-wl@lists.airs.net\\)"
301          wl-ml-draft-config-func                ;; function
302          ("From" . wl-from)                     ;; variable
303          ("Organization" . "~/.wl sample"))     ;; string
304         ("^Newsgroups: test.*"
305          ("Organization" . "organization for nntp."))
306         ))
307 ;; Change headers in draft preparation time.
308 ; (add-hook 'wl-mail-setup-hook
309 ;           '(lambda ()
310 ;              (unless wl-draft-reedit    ;; don't apply when reedit.
311 ;                (wl-draft-config-exec wl-draft-config-alist))))
312
313 ;; header value setting for mail reply.
314
315 ;; "a" (without-argument) reply to author (Reply-To or From).
316 ;; if 'X-ML-Name' and 'Reply-To' exists, reply to 'Reply-To'.
317 ; (setq wl-draft-reply-without-argument-list
318 ;       '((("X-ML-Name" "Reply-To") . (("Reply-To") nil nil))
319 ;       ("X-ML-Name" . (("To" "Cc") nil nil))
320 ;       ("Followup-To" . (nil nil ("Followup-To")))
321 ;       ("Newsgroups" . (nil nil ("Newsgroups")))
322 ;       ("Reply-To" . (("Reply-To") nil nil))
323 ;       ("Mail-Reply-To" . (("Mail-Reply-To") nil nil))
324 ;       ("From" . (("From") nil nil))))
325
326 ;; "C-u a" (with-argument) reply to all.
327 ; (setq wl-draft-reply-with-argument-list
328 ;       '(("Followup-To" . (("From") nil ("Followup-To")))
329 ;       ("Newsgroups" . (("From") nil ("Newsgroups")))
330 ;       ("Mail-Followup-To" . (("Mail-Followup-To") nil ("Newsgroups")))
331 ;       ("From" . (("From") ("To" "Cc") ("Newsgroups")))))
332
333
334 ;; X-Face (requires x-face (and x-face-mule))
335
336 (when (and window-system
337            (module-installed-p 'x-face))
338   (cond (wl-on-xemacs                           ;; for XEmacs
339          (autoload 'x-face-xmas-wl-display-x-face "x-face" nil t)
340          (setq wl-highlight-x-face-func
341                'x-face-xmas-wl-display-x-face))
342         ((module-installed-p 'x-face-mule)      ;; for Mule (GNU Emacs)
343          ;; after x-face-mule 0.20
344          (setq wl-highlight-x-face-func
345                (function
346                 (lambda (beg end)
347                   (x-face-mule-x-face-decode-message-header beg end))))
348          (setq x-face-mule-highlight-x-face-style 'xmas)
349          (require 'x-face-mule)
350          )))
351
352 ;; rule for auto refile.
353 ;(setq wl-refile-rule-alist
354 ;      '(
355 ;       ("x-ml-name"
356 ;        ("^Wanderlust" . "+wl")
357 ;        ("^Elisp" . "+elisp"))
358 ;       ("From"
359 ;        ("teranisi@isl.ntt.co.jp" . "+teranisi"))))
360
361 ;; Marks to skip auto-refile (default is "N" "U" "!").
362 ;; nil means all message is auto-refiled.
363 ;(setq wl-summary-auto-refile-skip-marks nil)
364
365 ;; Scoring.
366 ;; "all.SCORE" file is used regardless of wl-score-folder-alist.
367 ; (setq wl-score-folder-alist
368 ;       '(("^-comp\\."
369 ;        "news.comp.SCORE"
370 ;        "news.SCORE")
371 ;       ("^-"
372 ;        "news.SCORE")))
373 ;; directory for storing score files.
374 ; (setq wl-score-files-directory "~/.elmo/")
375
376
377 ;;;
378 ;;; end of file
379 ;;;