Unfortunately, there are some minor flaws in the patch I sent before. Please apply the newly attached one on top of the previous one.
As you can see, the add on patch uses regexp-quote where appropriate and, additionally, removes the Cc header if all addresses in that field are matched by the current From:.
--- gnus-pers.el.p1 2006-08-28 18:45:30.000000000 +0200 +++ gnus-pers.el 2006-08-28 21:23:12.000000000 +0200 @@ -474,15 +474,18 @@ (save-excursion (save-restriction (message-narrow-to-head) - (let ((rmail-dont-reply-to-names - (cadr (gnus-extract-address-components from))) - (cc (message-field-value "Cc"))) + (let ((case-fold-search t) + (rmail-dont-reply-to-names + (regexp-quote + (cadr (gnus-extract-address-components from)))) + (cc (message-fetch-field "cc"))) (when (and cc (string-match rmail-dont-reply-to-names cc)) + (message-remove-header "cc") (widen) - (message-remove-header "Cc") - (message-goto-cc) - (insert (rmail-dont-reply-to cc))) + (unless (string= "" (setq cc (rmail-dont-reply-to cc))) + (message-goto-cc) + (insert cc))) ) ) @@ -611,15 +614,18 @@ (save-excursion (save-restriction (message-narrow-to-head) - (let ((rmail-dont-reply-to-names - (cadr (gnus-extract-address-components from))) - (cc (message-field-value "Cc"))) + (let ((case-fold-search t) + (rmail-dont-reply-to-names + (regexp-quote + (cadr (gnus-extract-address-components from)))) + (cc (message-fetch-field "cc"))) (when (and cc (string-match rmail-dont-reply-to-names cc)) + (message-remove-header "cc") (widen) - (message-remove-header "Cc") - (message-goto-cc) - (insert (rmail-dont-reply-to cc))) + (unless (string= "" (setq cc (rmail-dont-reply-to cc))) + (message-goto-cc) + (insert cc))) ) )
pgpPofxecAxZP.pgp
Description: PGP signature