Fixed wl-draft-config-alist.
[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 (autoload 'wl "wl" "Wanderlust" t)
8 (autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t)
9 ;; for .emacs end
10
11 ;; Icon directory
12 ;; (No need if installed as XEmacs package.)
13 ;(setq wl-icon-directory "/usr/local/lib/emacs/etc")
14
15
16 ;; [[ SEMI Setting ]]
17
18 ;; Disable inline display of HTML part.
19 ;; Put before load `mime-setup'
20 (setq mime-setup-enable-inline-html nil)
21
22 ;; Don't split large message.
23 (setq mime-edit-split-message nil)
24
25 ;; If lines of message are larger than this value, treat it as `large'.
26 ;(setq mime-edit-message-default-max-lines 1000)
27
28
29 ;;; [[ Private Setting ]]
30
31 ;; Header From:
32 ;(setq wl-from "Your Name <e-mail@example.com>")
33
34 ;; User's mail addresses.
35 (setq wl-user-mail-address-list
36       (list (wl-address-header-extract-address wl-from)
37             ;; "e-mail2@example.com"
38             ;; "e-mail3@example.net" ...
39             ))
40
41 ;; Subscribed mailing list.
42 (setq wl-subscribed-mailing-list
43       '("wl@lists.airs.net"
44         "apel-ja@m17n.org"
45         "emacs-mime-ja@m17n.org"
46         ;; "ml@example.com" ...
47         ))
48
49 ;; If (system-name) does not return FQDN,
50 ;; set following as a local domain name without hostname.
51 ;; ((system-name) "." wl-local-domain is used as domain part of Message-ID
52 ;; and an argument of HELO in SMTP.
53 ;(setq wl-local-domain "example.com")
54
55 ;; Specific domain part for message-id.
56 ;(setq wl-message-id-domain "hostname.example.com")
57
58
59 ;;; [[ Server Setting ]]
60
61 ;; Default IMAP4 server
62 (setq elmo-imap4-default-server "localhost")
63 ;; Default POP server
64 (setq elmo-pop3-default-server "localhost")
65 ;; SMTP server
66 (setq wl-smtp-posting-server "localhost")
67 ;; Default NNTP server
68 (setq elmo-nntp-default-server "localhost")
69 ;; NNTP server name for posting
70 (setq wl-nntp-posting-server elmo-nntp-default-server)
71
72 ;; IMAP authenticate type setting
73 (setq elmo-imap4-default-authenticate-type 'clear) ; raw
74 ;(setq elmo-imap4-default-authenticate-type 'cram-md5) ; CRAM-MD5
75
76 ;; POP-before-SMTP
77 ;(setq wl-draft-send-mail-function 'wl-draft-send-mail-with-pop-before-smtp)
78
79
80 ;;; [[ Basic Setting ]]
81
82 ;; Default folder for `wl-summary-goto-folder'.
83 ;(setq wl-default-folder "+inbox")
84
85 ;; Default string for folder name completion.
86 ;(setq wl-default-spec "+")
87
88 ;; Folder Carbon Copy
89 ;(setq wl-fcc "+outbox")
90
91 ;; Confirm before exitting Wanderlust.
92 (setq wl-interactive-exit t)
93
94 ;; Confirm before sending message.
95 (setq wl-interactive-send t)
96
97 ;; Create opened thread.
98 ;(setq wl-thread-insert-opened t)
99
100 ;; Keep folder window beside summary. (3 pane)
101 ;(setq wl-stay-folder-window t)
102
103 ;; Truncate long lines.
104 ;(setq wl-message-truncate-lines t)
105 ;(setq wl-draft-truncate-lines t)
106 ;; Following line is needed for XEmacs older than 21.4.6.
107 ;(setq truncate-partial-width-windows nil)
108
109 ;; Open new frame for draft buffer.
110 ;(setq wl-draft-use-frame t)
111
112 ;; Don't limit indent for thread view
113 ;(setq wl-summary-indent-length-limit nil)
114 ;(setq wl-summary-width nil)
115
116 ;; Divide thread by change of subject.
117 ;(setq wl-summary-divide-thread-when-subject-changed t)
118
119 ;; Change format of thread view
120 ;(setq wl-thread-indent-level 2)
121 ;(setq wl-thread-have-younger-brother-str "+"
122 ;      wl-thread-youngest-child-str      "+"
123 ;      wl-thread-vertical-str            "|"
124 ;      wl-thread-horizontal-str          "-"
125 ;      wl-thread-space-str               " ")
126
127 ;; display first message automatically.
128 ;(setq wl-auto-select-first t)
129
130 ;; goto next folder when exit from summary.
131 ;(setq wl-auto-select-next t)
132
133 ;; skip folder if there is no unread message.
134 ;(setq wl-auto-select-next 'skip-no-unread)
135
136 ;; jump to unread message in 'N' or 'P'.
137 ;(setq wl-summary-move-order 'unread)
138
139 ;; notify mail arrival
140 ;(setq wl-biff-check-folder-list '("%inbox"))
141 ;(setq wl-biff-notify-hook '(ding))
142
143
144 ;;; [[ Network ]]
145
146 ;; cache setting.
147 ;; (messages in localdir, localnews, maildir are not cached.)
148 ;(setq elmo-archive-use-cache nil)
149 ;(setq elmo-nntp-use-cache t)
150 ;(setq elmo-imap4-use-cache t)
151 ;(setq elmo-pop3-use-cache t)
152
153 ;; Enable disconnected operation in IMAP folder.
154 ;(setq elmo-enable-disconnected-operation t)
155
156 ;; Store draft message in queue folder if message is sent in unplugged status.
157 (setq wl-draft-enable-queuing t)
158 ;; when plug status is changed from unplugged to plugged,
159 ;; queued message is flushed automatically.
160 (setq wl-auto-flush-queue t)
161
162 ;; offline at startup.
163 ;(setq wl-plugged nil)
164 ;; change plug status by server or port at startup.
165 ;(add-hook 'wl-make-plugged-hook
166 ;         '(lambda ()
167 ;            ;; Add or Change plug status for SERVER and PORT.
168 ;            (elmo-set-plugged plugged(t/nil) server port)
169 ;            ;; When omit port, SEVERS all port was changes.
170 ;            ;; (Can't add plug status without PORT)
171 ;            (elmo-set-plugged plugged(t/nil) server)
172 ;            ))
173
174
175 ;;; [[ Special Setting ]]
176
177 ;; open unread group folder after checking.
178 ;(add-hook 'wl-folder-check-entity-hook
179 ;         '(lambda ()
180 ;            (wl-folder-open-unread-folder entity)
181 ;            ))
182
183 ;; Change summary display function.
184
185 ;; Set extra field use with `elmo-msgdb-overview-entity-get-extra-field'.
186 ;; And use with auto-refile.
187 (setq elmo-msgdb-extra-fields
188       '("newsgroups"
189         "list-id" "x-ml-name" "mailing-list"
190         "x-mail-count" "x-ml-count" "x-sequence"))
191
192 ;; ML message displays ML name and ML sequence number in subject.
193 (setq wl-summary-subject-function 'my-wl-summary-subject-func-ml)
194 (defun my-wl-summary-subject-func-ml (subject-string)
195   (let ((folder wl-summary-buffer-folder-name)
196         (subj subject-string) (sequence) (ml-name) (ml-count))
197     (setq sequence (elmo-msgdb-overview-entity-get-extra-field
198                     entity "x-sequence")
199           ml-name (or (elmo-msgdb-overview-entity-get-extra-field
200                        entity "x-ml-name")
201                       (and sequence
202                            (car (split-string sequence " "))))
203           ml-count (or (elmo-msgdb-overview-entity-get-extra-field
204                         entity "x-mail-count")
205                        (elmo-msgdb-overview-entity-get-extra-field
206                         entity "x-ml-count")
207                        (and sequence
208                             (cadr (split-string sequence " ")))))
209     (if (string-match
210          "^\\s(\\(\\S)+\\)[ :]\\([0-9]+\\)\\s)[ \t]*"
211          subject-string)
212         (progn
213           (setq subj (substring subject-string (match-end 0)))
214           (if (not ml-name) (setq ml-name (match-string 1 subject-string)))
215           (if (not ml-count) (setq ml-count (match-string 2 subject-string)))))
216     (condition-case nil
217         (if (and ml-name ml-count)
218             (if (string= folder wl-default-folder)
219                 (format "(%s %05d) %s"
220                         (car (split-string ml-name " "))
221                         (string-to-int ml-count)
222                         subj)
223               (format "#%05d %s"
224                       (string-to-int ml-count) subj))
225           subj)
226       (error subj))))
227
228 ;; imput asynchronously.
229 ;; (utils/im-wl.el is needed to be installed.
230 ;;  Don't forget setting ~/.im/Config (Smtpservers).
231 ;;  note that wl-draft-enable-queuing is not valid.)
232 ;(autoload 'wl-draft-send-with-imput-async "im-wl")
233 ;(setq wl-draft-send-function 'wl-draft-send-with-imput-async)
234
235
236 ;; non-verbose User-Agent: field
237 ;(setq wl-generate-mailer-string-function
238 ;      (function
239 ;       (lambda ()
240 ;        (concat "User-Agent: "
241 ;                (wl-generate-user-agent-string-1 nil)))))
242
243
244 ;;; [[ Template ]]
245
246 ;; template
247 (setq wl-template-alist
248       '(("default"
249          ("From" . wl-from)
250          ("Organization" . "~/.wl sample")
251          (body . "Hello, this is XXX \n"))              ;; body
252         ("report"
253          ("To" . "boss@example.com")
254          ("Subject" . "Report")
255          (top . "Sir, here is my report\n")             ;; insert in top.
256 ;;       (bottom-file . "~/work/report.txt")    ;; insert file in bottom
257          )
258         ))
259 ;; Change headers in draft sending time.
260 (setq wl-draft-config-alist
261       '((reply                          ; see reply buffer
262          "^To: .*test-notsend-wl@lists\\.airs\\.net"
263          (template . "default"))        ; template
264         ("^To: .*test-notsend-wl@lists\\.airs\\.net"
265          ding                           ; function
266          ("From" . wl-from)             ; variable
267          ("Organization" . "CHANGE THIS!!")) ; string
268         ("^Newsgroups: test.*"
269          ("Organization" . "organization for nntp."))
270         ))
271
272 ;; Change headers in draft preparation time.
273 ;(add-hook 'wl-mail-setup-hook
274 ;         '(lambda ()
275 ;            (unless wl-draft-reedit;   ; don't apply when reedit.
276 ;              (wl-draft-config-exec wl-draft-config-alist))))
277
278
279 ;; [[ Reply ]]
280 ;; header value setting for mail reply.
281
282 ;; Wide window for draft buffer.
283 ;(setq wl-draft-reply-buffer-style 'full)
284
285 ;; Remove fullname in reply message header.
286 ;(setq wl-draft-reply-use-address-with-full-name nil)
287
288 ;; "a" (without-argument) reply to author (Reply-To or From).
289 ;; if 'X-ML-Name' and 'Reply-To' exists, reply to 'Reply-To'.
290 (setq wl-draft-reply-without-argument-list
291       '((("X-ML-Name" "Reply-To") . (("Reply-To") nil nil))
292         ("X-ML-Name" . (("To" "Cc") nil nil))
293         ("Followup-To" . (nil nil ("Followup-To")))
294         ("Newsgroups" . (nil nil ("Newsgroups")))
295         ("Reply-To" . (("Reply-To") nil nil))
296         ("Mail-Reply-To" . (("Mail-Reply-To") nil nil))
297         ("From" . (("From") nil nil))))
298
299 ;; "C-u a" (with-argument) reply to all.
300 (setq wl-draft-reply-with-argument-list
301       '(("Followup-To" . (("From") nil ("Followup-To")))
302         ("Newsgroups" . (("From") nil ("Newsgroups")))
303         ("Mail-Followup-To" . (("Mail-Followup-To") nil ("Newsgroups")))
304         ("From" . (("From") ("To" "Cc") ("Newsgroups")))))
305
306
307 ;;; [[ Message Display Settings ]]
308
309 ;; Hidden header field in message buffer.
310 (setq wl-message-ignored-field-list
311       '(".*Received:" ".*Path:" ".*Id:" "^References:"
312         "^Replied:" "^Errors-To:"
313         "^Lines:" "^Sender:" ".*Host:" "^Xref:"
314         "^Content-Type:" "^Precedence:"
315         "^Status:" "^X-VM-.*:"))
316
317 ;; Displayed header field in message buffer.
318 ;; This value precedes `wl-message-ignored-field-list'
319 (setq wl-message-visible-field-list '("^Message-Id:"))
320
321 ;; X-Face
322 (when window-system
323   (cond ((and (featurep 'xemacs)        ; for XEmacs
324               (module-installed-p 'x-face))
325          (autoload 'x-face-xmas-wl-display-x-face "x-face")
326          (setq wl-highlight-x-face-function 'x-face-xmas-wl-display-x-face))
327
328         ;; for Emacs21
329         ((and (not (featurep 'xemacs))
330               (= emacs-major-version 21)
331               (module-installed-p 'x-face-e21))
332          (autoload 'x-face-decode-message-header "x-face-e21")
333          (setq wl-highlight-x-face-function 'x-face-decode-message-header))
334
335         ;; for Emacs 19.34, Emacs 20.x
336         ((module-installed-p 'x-face-mule)
337          ;; x-face-mule distributed with bitmap-mule 8.0 or later
338          (autoload 'x-face-decode-message-header "x-face-mule")
339          (setq wl-highlight-x-face-function 'x-face-decode-message-header))
340         ))
341
342 ;; Scoring.
343 ;; "all.SCORE" file is used regardless of wl-score-folder-alist.
344 ;(setq wl-score-folder-alist
345 ;      '(("^-comp\\."
346 ;        "news.comp.SCORE"
347 ;        "news.SCORE")
348 ;       ("^-"
349 ;        "news.SCORE")))
350
351 ;; rule for auto refile.
352 ;(setq wl-refile-rule-alist
353 ;      '(
354 ;       ("x-ml-name"
355 ;        ("^Wanderlust" . "+wl")
356 ;        ("^Elisp" . "+elisp"))
357 ;       ("From"
358 ;        ("foo@example\\.com" . "+foo"))))
359
360 ;; Marks to skip auto-refile (default is "N" "U" "!").
361 ;; nil means all message is auto-refiled.
362 ;(setq wl-summary-auto-refile-skip-marks nil)
363
364 ;;; dot.wl ends here