diff options
author | David Bremner <bremner@unb.ca> | 2009-12-29 21:35:22 -0400 |
---|---|---|
committer | David Bremner <bremner@unb.ca> | 2009-12-29 21:44:55 -0400 |
commit | 299475296b1337e63b9634ba8e06834f73e0522d (patch) | |
tree | 452d96f2a6d0b859a839c4eba5a4db0e20a471eb /message-templ.el | |
parent | 3b4328ab150f4425ebe94907273cf1957c494349 (diff) |
add message-templ-config-exec()
This function tries to match a sequence of regexps on the headers, and
applies corresponding actions.
Diffstat (limited to 'message-templ.el')
-rw-r--r-- | message-templ.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/message-templ.el b/message-templ.el index 333d8ac..c76ae33 100644 --- a/message-templ.el +++ b/message-templ.el @@ -349,5 +349,26 @@ Set header-separator is MAIL-HEADER." (insert mail-header-separator "\n")) (messsage-templ-config-exec-sub template)))) +(defun message-templ-config-exec (&optional config-alist) + "Change headers according to the value of `message-templ-config-alist'." + (interactive) + (let ((case-fold-search t) + (alist (or config-alist message-templ-config-alist)) + local-variables key clist found) + (save-excursion + (while alist + (setq key (caar alist) + clist (cdar alist)) + (cond + ((stringp key) + (if (save-restriction + (message-narrow-to-headers) + (goto-char (point-min)) + (re-search-forward key nil t)) + (message-templ-config-exec-sub clist))) + ((eval key) + (message-templ-config-exec-sub clist))) + (setq alist (cdr alist)))))) + (provide 'message-templ) ;;; message-templ.el ends here |