>>>>> "Lars" == Lars Magne Ingebrigtsen : Lars> Jan Rychter writes: >> Is there a reason why posting styles have to be applied so early? Lars> Posting styles work (partly) by setting Message variables Lars> (locally), so it has to be run before Message does it's nefarious Lars> work. Silly me. Of course! Thanks for the hint. I feel enlightened. Would the following be more acceptable? (it works for me) It allows me to add to my posting styles things like: (".*icm\\.misc" (sign)) (".*icm\\.secret" (sign) (encrypt)) ... and have all messages (including replies) properly signed in groups matching that regexp. Should I bother to submit a proper patch including an update to the manual, or is it just me that needs this functionality? --J. diff -u /home/jwr/Mail/.software/gnus/lisp/gnus-msg.el.original /home/jwr/Mail/.software/gnus/lisp/gnus-msg.el --- /home/jwr/Mail/.software/gnus/lisp/gnus-msg.el.original 2003-06-26 21:23:07.000000000 -0700 +++ /home/jwr/Mail/.software/gnus/lisp/gnus-msg.el 2003-06-26 21:23:08.000000000 -0700 @@ -314,6 +314,9 @@ (defvar gnus-msg-force-broken-reply-to nil) +(defvar gnus-message-sign nil) +(defvar gnus-message-encrypt nil) + (defconst gnus-bug-message "Sending a bug report to the Gnus Towers. ======================================== @@ -1155,18 +1158,19 @@ (defun gnus-summary-handle-replysign () "Check the various replysign variables and take action accordingly." - (when (or gnus-message-replysign gnus-message-replyencrypt) + (when (or gnus-message-replysign gnus-message-replyencrypt + gnus-message-sign gnus-message-encrypt) (let (signed encrypted) (save-excursion (set-buffer gnus-article-buffer) (setq signed (memq 'signed gnus-article-wash-types)) (setq encrypted (memq 'encrypted gnus-article-wash-types))) - (cond ((and gnus-message-replyencrypt encrypted) + (cond ((or gnus-message-encrypt (and gnus-message-replyencrypt encrypted)) (mml-secure-message mml-default-encrypt-method (if gnus-message-replysignencrypted 'signencrypt 'encrypt))) - ((and gnus-message-replysign signed) + ((or gnus-message-sign (and gnus-message-replysign signed)) (mml-secure-message mml-default-sign-method 'sign)))))) (defun gnus-summary-reply-with-original (n &optional wide) @@ -1937,6 +1940,12 @@ (let ((message-signature ,(cdr result))) (when message-signature (message-insert-signature))))))) + ((eq 'encrypt (car result)) + `(lambda () + (set (make-local-variable 'gnus-message-encrypt) t))) + ((eq 'sign (car result)) + `(lambda () + (set (make-local-variable 'gnus-message-sign) t))) (t (let ((header (if (symbolp (car result))