| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can set wl-draft-config-alist so that header and body of the
message will automatically modified depending on information of header
and others.
The initial setting of wl-draft-config-alist is nil.
In the example below, the header is modified when
wl-draft-send-and-exit or wl-draft-send is invoked. You
can set wl-interactive-send to non-nil so as to confirm changes
before sending the message.
(setq wl-draft-config-alist
'(((string-match "aaa\\.example\\.com$" (system-name))
;; applied if the expression is non-nil
(wl-smtp-posting-server . "mailserver-B")
(wl-nntp-posting-server . "newsserver-B")
;; settings of temporary variables
)
("^To: .*user@aaa\\.bbb\\.example\\.com"
;; applied if it matches the header of the draft buffer
("Organization" . (format "Go %s" my-webpage)))
;; you can write elisp expressions here (eval only)
(top . "Hello.\n") ;; inserted at the top of the body
(bottom . "\nBye.\n") ;; inserted at the bottom of the body
))
|
The format of wl-draft-config-alist is:
'(("regexp of the header" or elisp expression
("Field" . value(elisp expression))
(variable . value(elisp expression))
(sub-function . value(elisp expression))
function
...)
("regexp of the header" or elisp expression
("Field" . value(elisp expression))
...))
|
Per default, there are 13 following sub-functions.
'header: Inserts the specified string at the bottom of the header.
'header-top: Inserts the specified string at the top of the header.
'header-file: Inserts the specified file at the bottom of the header.
'x-face: Inserts `X-Face:' field with the content of the specified file.
'top: Inserts the specified string at the top of the body.
'top-file: Inserts the specified file at the top of the body.
'body: Replaces the body with the specified string.
Specifying |
These are defined in wl-draft-config-sub-func-alist and you can
change them or add your own functions. If you read the code, you can
easily find how to write the functions.
At the first of each item, a regular expression of the header or an elisp expression should be specified. In the case of an elisp expression, the item is applied when the expression is evaluated non-nil.
Per default, when multiple items match or are evaluated non-nil, all
such items are applied, but if you set a variable
wl-draft-config-matchone to t, only the first matching one
is applied.
At the second of the item, a cons or a list of functions should be specified. The car part of the cons should be a header field, a variable, or a sub-function. When a header field is specified, the field will be modified. If a variable is specified, the value of the variable will be modified temporarily.
In the cdr part of a cons, not only a variable but also an elisp
expression can be specified as is. If the car part is a header field
and the cdr part is nil, the field will be deleted.
See the next example as well:
(setq wl-draft-config-alist
'((reply ;; (1)
"X-ML-Name: \\(Wanderlust\\|emacs-mime-ja\\|apel-ja\\)"
;; applied if it matches the header of the buffer being replied
(body . " Hello.\n")
(template . "default")
)))
|
As in the (1) above, if a header regexp is prepended with reply,
it is applied when the draft is prepared by wl-summary-reply for
example, and when it matches the header being replied. It is ignored
when there is no buffer being replied, like after wl-draft was
invoked.
If you want to use name of parent folder, you can refer the buffer local
variable wl-draft-parent-folder. In the following example, Wanderlust
changes From according to the folder name of the summary in which the draft
was invoked.
(setq wl-draft-config-alist
'(((string-match \".*@domain1$\" wl-draft-parent-folder)
(\"From\" . \"user@domain1\"))
((string-match \".*@domain2$\" wl-draft-parent-folder)
(\"From\" . \"user@domain2\"))))
|
Note that wl-draft-config-alist is applied only once when
wl-draft-send-and-exit or wl-draft-send is invoked.
Therefore, if you want to apply wl-draft-config-alist again after
aborting transmission, execute C-c C-e
(wl-draft-config-exec) explicitly.
If you don't want to apply wl-draft-config-alist when
wl-draft-send-and-exit or wl-draft-send is invoked,
do the following:
(remove-hook 'wl-draft-send-hook 'wl-draft-config-exec) |
If you want to apply wl-draft-config-alist when a draft buffer is
prepared, do the following:
(add-hook 'wl-mail-setup-hook 'wl-draft-config-exec) |
If you want to apply wl-draft-config-alist when you re-edit a mail
from summary mode by typing E(wl-summary-reedit), do the
following:
(add-hook 'wl-draft-reedit-hook 'wl-draft-config-exec) |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |