[mew-int 00408] automagic fcc selection on send...
David A. Panariti
davep at example.com
Tue Aug 7 11:45:07 JST 2001
I don't know if this is the best place for things like this, but there
aren't a lot of choices for mew mailing lists.
In line with mew's wonderful refile abilities, here is some code I've
been using for a while in other mailers and now in mew.
(I hope I didn't miss a builtin feature)
I like to keep fcc's related to message recipients as I send mail. I
prefer this to getting a bunch in a single place and then refiling all
at once.
So here is the code. I've grabbed the code from various elisp files,
so let me know if I've missed anything.
Enjoy.
(defvar dp-mail-header-terminator "^--------$"
"RE to find end of mail headers.")
(defun dp-replace-fcc (fcc-val hdr-terminator)
"Replace or add an fcc header."
(save-excursion
(goto-char (point-min))
(if (re-search-forward "^[fF]cc:.*$" nil t)
(replace-match (concat "Fcc: " fcc-val))
(if (re-search-forward hdr-terminator nil t)
(progn
(beginning-of-line)
(insert (concat "Fcc: " fcc-val "\n")))
(message "Cannot find Fcc: field or header delimitter.")))))
(defun dp-mew-send-hook ()
"Send hook. Compute destination fcc folder by guessing with
mew-refile-guess-by-alist."
(interactive)
(let ((fcc-list (or (mew-refile-guess-by-alist) '("+sent_mail")))
fcc-val)
(setq fcc-val (mapconcat (function identity) fcc-list ", "))
(dp-replace-fcc fcc-val dp-mail-header-terminator)))
Set a hook like so:
(add-hook 'mew-send-hook 'dp-mew-send-hook)
And you're set.
Regards,
davep
--
If entropy is increasing, where is it coming from?
More information about the Mew-int
mailing list