--- texi/gnus.texi.original 2003-06-19 13:27:45.000000000 -0700 +++ texi/gnus.texi 2003-06-19 13:35:05.000000000 -0700 @@ -11701,12 +11701,20 @@ attribute name can be one of @code{signature}, @code{signature-file}, @code{x-face-file}, @code{address} (overriding @code{user-mail-address}), @code{name} (overriding -@code{(user-full-name)}) or @code{body}. The attribute name can also -be a string or a symbol. In that case, this will be used as a header -name, and the value will be inserted in the headers of the article; if -the value is @code{nil}, the header name will be removed. If the -attribute name is @code{eval}, the form is evaluated, and the result -is thrown away. +@code{(user-full-name)}), @code{eval}, @code{call} or @code{body}. The +attribute name can also be a string or a symbol. In that case, this +will be used as a header name, and the value will be inserted in the +headers of the article; if the value is @code{nil}, the header name will +be removed. If the attribute name is @code{eval}, the form is +evaluated, and the result is thrown away. If the attribute name is +@code{call}, the function supplied as @var{value} is called with no +arguments as part of the message setup process. The difference between +@code{eval} and @code{call} is that functions supplied as @code{eval} +are called immediately, while those supplied by @code{call} are called +as part of the @code{message-setup-hook}, after essential headers have +been set up. This is important if the function being called expects +things like @var{mail-header-separator} to be present in the message +when it gets called. The attribute value can be a string (used verbatim), a function with zero arguments (the return value will be used), a variable (its value @@ -11756,7 +11764,9 @@ (set-buffer gnus-article-buffer) (message-fetch-field "to")))) ("^nn.+:" - (signature-file "~/.mail-signature")))) + (signature-file "~/.mail-signature")) + ("^comp\\.security.*" + (call mml-secure-message-sign-pgpmime)))) @end lisp The @samp{nnml:.*} rule means that you use the @code{To} address as the --- lisp/gnus-msg.el.original 2003-06-19 12:40:37.000000000 -0700 +++ lisp/gnus-msg.el 2003-06-19 12:57:35.000000000 -0700 @@ -1880,18 +1880,20 @@ (t (car attribute)))) ;; We get the value. - (setq v - (cond - ((stringp value) - value) - ((or (symbolp value) - (functionp value)) - (cond ((functionp value) - (funcall value)) - ((boundp value) - (symbol-value value)))) - ((listp value) - (eval value)))) + (if (eq element 'call) + (setq v value) + (setq v + (cond + ((stringp value) + value) + ((or (symbolp value) + (functionp value)) + (cond ((functionp value) + (funcall value)) + ((boundp value) + (symbol-value value)))) + ((listp value) + (eval value))))) ;; Translate obsolescent value. (cond ((eq element 'signature-file) @@ -1937,6 +1939,8 @@ (let ((message-signature ,(cdr result))) (when message-signature (message-insert-signature))))))) + ((eq 'call (car result)) + (cdr result)) (t (let ((header (if (symbolp (car result))