Refine sample files.
[elisp/wanderlust.git] / samples / en / dot.wl
1 ;;; dot.wl -- sample setting file for Wanderlust        -*- emacs-lisp -*-
2
3 ;; [[ Requirement Setting ]]
4
5 ;; Following must be included in ~/.emacs
6 ;; for .emacs begin
7 (require 'mime-setup)
8 (autoload 'wl "wl" "Wanderlust" t)
9 (autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t)
10 ;; for .emacs end
11
12 ;; Icon directory (XEmacs and Emacs21 only)
13 ;; (No need if installed as XEmacs package.)
14 ;(setq wl-icon-dir "/usr/local/lib/emacs/etc")
15
16
17 ;;; [[ Private Setting ]]
18
19 ;; Header From:
20 ;(setq wl-from "Your Name <e-mail@example.com>")
21
22 ;; User's mail addresses.
23 (setq wl-user-mail-address-list
24       (list (wl-address-header-extract-address wl-from)
25             ;; "e-mail2@example.com"
26             ;; "e-mail3@example.net" ...
27             ))
28
29 ;; Subscribed mailing list.
30 (setq wl-subscribed-mailing-list
31       '("wl@lists.airs.net"
32         "apel-ja@m17n.org"
33         ;;"ml@example.com" ...
34         ))
35
36
37 ;;; [[ Server Setting ]]
38
39 ;; Default IMAP4 server
40 (setq elmo-default-imap4-server "localhost")
41 ;; Default POP server
42 (setq elmo-default-pop3-server "localhost")
43 ;; SMTP server
44 (setq wl-smtp-posting-server "localhost")
45 ;; Default NNTP server
46 (setq elmo-default-nntp-server "localhost")
47 ;; NNTP server name for posting
48 (setq wl-nntp-posting-server elmo-default-nntp-server)
49
50 ;; If (system-name) does not return FQDN,
51 ;; set following as a local domain name without hostname.
52 ;; ((system-name) "." wl-local-domain is used as domain part of Message-ID
53 ;; and an argument of HELO in SMTP.
54 ;(setq wl-local-domain "example.com")
55
56 ;; Specific domain part for message-id.
57 ;(setq wl-message-id-domain "hostname.example.com")
58
59
60 ;;; [[ Basic Setting ]]
61
62 ;; Default folder for `wl-summary-goto-folder'.
63 ;(setq wl-default-folder "+inbox")
64
65 ;; Default string for folder name completion.
66 ;(setq wl-default-spec "+")
67
68 ;; Folder Carbon Copy
69 ;(setq wl-fcc "+outbox")
70
71 ;; Confirm at exit time.
72 (setq wl-interactive-exit t)
73
74 ;; Confirm at message sending time.
75 (setq wl-interactive-send t)
76
77 ;; Create opened thread.
78 ;(setq wl-thread-insert-opened t)
79
80 ;; folder mode and summary mode is displayed at the same time. (3pane)
81 ;(setq wl-stay-folder-window t)
82
83 ;; Open new frame for draft buffer.
84 ;(setq wl-draft-use-frame t)
85
86 ;; Disable inline display HTML part.
87 ;(setq mime-setup-enable-inline-html nil)
88
89 ;; Don't split large message.
90 ;(setq mime-edit-split-message nil)
91
92 ;; Thread divide when change subject.
93 ;(setq wl-summary-divide-thread-when-subject-changed t)
94
95 ;; Thread view
96 ;(setq wl-thread-have-younger-brother-str "+"
97 ;      wl-thread-youngest-child-str      "+"
98 ;      wl-thread-vertical-str            "|"
99 ;      wl-thread-horizontal-str          "-"
100 ;      wl-thread-space-str               " ")
101
102 ;; display first message automatically.
103 ;(setq wl-auto-select-first t)
104
105 ;; goto next folder when exit from summary.
106 ;(setq wl-auto-select-next t)
107
108 ;; folder is skipped if there is no unread.
109 ;(setq wl-summary-next-no-unread 'skip-no-unread)
110
111 ;; jump to unread message in 'N' or 'P'.
112 ;(setq wl-summary-move-order 'unread)
113
114
115 ;;; [[ Network ]]
116
117 ;; cache setting.
118 ;; (messages in localdir, localnews, maildir are not cached.)
119 ;(setq elmo-archive-use-cache nil)
120 ;(setq elmo-nntp-use-cache t)
121 ;(setq elmo-imap4-use-cache t)
122 ;(setq elmo-pop3-use-cache t)
123
124 ;; Enable disconnected operation in IMAP folder.
125 ;(setq elmo-enable-disconnected-operation t)
126
127 ;; Store draft message in queue folder if message is sent in unplugged status.
128 (setq wl-draft-enable-queuing t)
129 ;; when plug status is changed from unplugged to plugged,
130 ;; queued message is flushed automatically.
131 (setq wl-auto-flush-queue t)
132
133 ;; offline at startup.
134 ;(setq wl-plugged nil)
135 ;; change plug status by server or port at startup.
136 ;(add-hook 'wl-make-plugged-hook
137 ;         '(lambda ()
138 ;            (elmo-set-plugged plugged(t/nil) server port)
139 ;            (elmo-set-plugged plugged(t/nil) server)
140 ;            ))
141
142
143 ;;; [[ Special Setting ]]
144
145 ;; open unread group folder after checking.
146 (add-hook 'wl-folder-check-entity-hook
147           '(lambda ()
148              (wl-folder-open-unread-folder entity)
149              ))
150
151 ;; Change summary display function.
152
153 ;; get extra field values as overview information (only localdir folder).
154 (setq elmo-msgdb-extra-fields '("newsgroups"
155                                 "x-ml-name" "list-id"
156                                 "x-mail-count" "x-ml-count" "x-sequence"
157                                 "mailing-list"))
158
159 ;; ML message displays ML name and ML sequence number in subject.
160 (setq wl-summary-subject-func 'my-wl-summary-subject-func-ml)
161 (defun my-wl-summary-subject-func-ml (subject-string)
162   (let ((folder wl-summary-buffer-folder-name)
163         (subj subject-string) (sequence) (ml-name) (ml-count))
164     (setq sequence (elmo-msgdb-overview-entity-get-extra-field
165                     entity "x-sequence")
166           ml-name (or (elmo-msgdb-overview-entity-get-extra-field
167                        entity "x-ml-name")
168                       (and sequence
169                            (car (split-string sequence " "))))
170           ml-count (or (elmo-msgdb-overview-entity-get-extra-field
171                         entity "x-mail-count")
172                        (elmo-msgdb-overview-entity-get-extra-field
173                         entity "x-ml-count")
174                        (and sequence
175                             (cadr (split-string sequence " ")))))
176     (if (string-match
177          "^\\s(\\(.+\\)[ :]\\([0-9]+\\)\\s)[ \t]*"
178          subject-string)
179         (progn
180           (setq subj (substring subject-string (match-end 0)))
181           (if (not ml-name) (setq ml-name (match-string 1 subject-string)))
182           (if (not ml-count) (setq ml-count (match-string 2 subject-string)))))
183     (if (and ml-name ml-count)
184         (if (string= folder wl-default-folder)
185             (format "(%s %05d) %s"
186                     (car (split-string ml-name " "))
187                     (string-to-int ml-count)
188                     subj)
189           (format "#%05d %s"
190                   (string-to-int ml-count) subj))
191       subj)))
192
193 ;; imput asynchronously.
194 ;; (utils/im-wl.el is needed to be installed.
195 ;;  Don't forget setting ~/.im/Config (Smtpservers).
196 ;;  note that wl-draft-enable-queuing is not valid.)
197 ;(autoload 'wl-draft-send-with-imput-async "im-wl")
198 ;(setq wl-draft-send-func 'wl-draft-send-with-imput-async)
199
200
201 ;; non-verbose User-Agent: field
202 ;(setq wl-generate-mailer-string-function
203 ;      (function
204 ;       (lambda ()
205 ;        (wl-generate-user-agent-string-1 nil))))
206
207
208 ;;; [[ Template ]]
209
210 ;; template
211 (setq wl-template-alist
212       '(("default"
213          ("From" . wl-from)
214          ("Organization" . "~/.wl sample")
215          (body . "Hello, this is XXX \n"))              ;; body
216         ("report"
217          ("To" . "boss@example.com")
218          ("Subject" . "Report")
219          (top . "Sir, here is my report\n")             ;; insert in top.
220 ;;       (bottom-file . "~/work/report.txt")    ;; insert file in bottom
221          )
222         ))
223 ;; Change headers in draft sending time.
224 (setq wl-draft-config-alist
225       '((reply          ;; see reply buffer
226          "^To: .*\\(test-notsend-wl@lists.airs.net\\)"
227          (template . "default"))                ;; template
228         ("^To: .*\\(test-notsend-wl@lists.airs.net\\)"
229          wl-ml-draft-config-func                ;; function
230          ("From" . wl-from)                     ;; variable
231          ("Organization" . "~/.wl sample"))     ;; string
232         ("^Newsgroups: test.*"
233          ("Organization" . "organization for nntp."))
234         ))
235
236 ;; Change headers in draft preparation time.
237 ;(add-hook 'wl-mail-setup-hook
238 ;         '(lambda ()
239 ;            (unless wl-draft-reedit;   ; don't apply when reedit.
240 ;              (wl-draft-config-exec wl-draft-config-alist))))
241
242
243 ;; [[ Reply ]]
244 ;; header value setting for mail reply.
245
246 ;; Wide window for draft buffer.
247 ;(setq wl-draft-reply-buffer-style 'full)
248
249 ;; Remove fullname in reply message header.
250 ;(setq wl-draft-reply-use-address-with-full-name nil)
251
252 ;; "a" (without-argument) reply to author (Reply-To or From).
253 ;; if 'X-ML-Name' and 'Reply-To' exists, reply to 'Reply-To'.
254 (setq wl-draft-reply-without-argument-list
255       '((("X-ML-Name" "Reply-To") . (("Reply-To") nil nil))
256         ("X-ML-Name" . (("To" "Cc") nil nil))
257         ("Followup-To" . (nil nil ("Followup-To")))
258         ("Newsgroups" . (nil nil ("Newsgroups")))
259         ("Reply-To" . (("Reply-To") nil nil))
260         ("Mail-Reply-To" . (("Mail-Reply-To") nil nil))
261         ("From" . (("From") nil nil))))
262
263 ;; "C-u a" (with-argument) reply to all.
264 (setq wl-draft-reply-with-argument-list
265       '(("Followup-To" . (("From") nil ("Followup-To")))
266         ("Newsgroups" . (("From") nil ("Newsgroups")))
267         ("Mail-Followup-To" . (("Mail-Followup-To") nil ("Newsgroups")))
268         ("From" . (("From") ("To" "Cc") ("Newsgroups")))))
269
270
271 ;; X-Face (requires x-face (and x-face-mule))
272 (when (and window-system
273            (module-installed-p 'x-face))
274   (cond (wl-on-xemacs                   ;; for XEmacs
275          (autoload 'x-face-xmas-wl-display-x-face "x-face" nil t)
276          (setq wl-highlight-x-face-func
277                'x-face-xmas-wl-display-x-face))
278         ;; for Mule (GNU Emacs)
279         ((module-installed-p 'x-face-mule)
280          ;; x-face-mule 0.20\e$B0J8e\e(B
281          (setq wl-highlight-x-face-func
282                (function
283                 (lambda (&rest dummy)
284                   (x-face-decode-message-header))))
285          (require 'x-face-mule)
286          )))
287
288 ;; rule for auto refile.
289 ;(setq wl-refile-rule-alist
290 ;      '(
291 ;       ("x-ml-name"
292 ;        ("^Wanderlust" . "+wl")
293 ;        ("^Elisp" . "+elisp"))
294 ;       ("From"
295 ;        ("teranisi@isl.ntt.co.jp" . "+teranisi"))))
296
297 ;; Marks to skip auto-refile (default is "N" "U" "!").
298 ;; nil means all message is auto-refiled.
299 ;(setq wl-summary-auto-refile-skip-marks nil)
300
301 ;; Scoring.
302 ;; "all.SCORE" file is used regardless of wl-score-folder-alist.
303 ;(setq wl-score-folder-alist
304 ;      '(("^-comp\\."
305 ;        "news.comp.SCORE"
306 ;        "news.SCORE")
307 ;       ("^-"
308 ;        "news.SCORE")))
309
310 ;; directory for storing score files.
311 ; (setq wl-score-files-directory "~/.elmo/")
312
313 ;;; dot.wl ends here