From 8e5b28c45280981822c7d3c1b41f8a2311af88f0 Mon Sep 17 00:00:00 2001 From: Didier Verna Date: Tue, 30 May 2006 09:47:14 +0000 Subject: [PATCH] lisp/ChangeLog addition: 2006-05-30 Didier Verna * message.el (message-dont-reply-to-names): Update the custom type. * message.el (message-dont-reply-to-names): New defsubst: potentially convert a list of regexps into a single one. * message.el (message-get-reply-headers): Use it. * nnmail.el (nnmail-fancy-expiry-target): Ditto. texi/ChangeLog addition: 2006-05-30 Didier Verna * message.texi (Wide Reply): Update documentation of message-dont-reply-to-names (now allowing a list of regexps). --- lisp/ChangeLog | 8 ++++++++ lisp/message.el | 23 +++++++++++++++++++---- lisp/nnmail.el | 2 +- texi/ChangeLog | 5 +++++ texi/message.texi | 3 ++- 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 805e4fdcb..f891a92cb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2006-05-30 Didier Verna + + * message.el (message-dont-reply-to-names): Update the custom type. + * message.el (message-dont-reply-to-names): New defsubst: potentially + convert a list of regexps into a single one. + * message.el (message-get-reply-headers): Use it. + * nnmail.el (nnmail-fancy-expiry-target): Ditto. + 2006-05-30 Katsumi Yamaoka * gnus-agent.el (directory-files-and-attributes): Move forward. diff --git a/lisp/message.el b/lisp/message.el index fe4378299..54079f400 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1149,13 +1149,28 @@ If nil, you might be asked to input the charset." (defcustom message-dont-reply-to-names (and (boundp 'rmail-dont-reply-to-names) rmail-dont-reply-to-names) - "*A regexp specifying addresses to prune when doing wide replies. -A value of nil means exclude your own user name only." + "*Addresses to prune when doing wide replies. +This can be a regexp or a list of regexps. Also, a value of nil means +exclude your own user name only." :version "21.1" :group 'message :link '(custom-manual "(message)Wide Reply") :type '(choice (const :tag "Yourself" nil) - regexp)) + regexp + (repeat :tag "Regexp List" regexp))) + +;; #### FIXME: this might become a generally usefull function at some point +;; --dlv. +(defsubst message-dont-reply-to-names () + "Potentially convert a list of regexps into a single one." + (cond ((null message-dont-reply-to-names) + nil) + ((stringp message-dont-reply-to-names) + message-dont-reply-to-names) + ((listp message-dont-reply-to-names) + (mapconcat (lambda (elt) (concat "\\(" elt "\\)")) + message-dont-reply-to-names + "\\|")))) (defvar message-shoot-gnksa-feet nil "*A list of GNKSA feet you are allowed to shoot. @@ -6013,7 +6028,7 @@ want to get rid of this query permanently."))) (while (string-match "[ \t][ \t]+" recipients) (setq recipients (replace-match " " t t recipients))) ;; Remove addresses that match `rmail-dont-reply-to-names'. - (let ((rmail-dont-reply-to-names message-dont-reply-to-names)) + (let ((rmail-dont-reply-to-names (message-dont-reply-to-names))) (setq recipients (rmail-dont-reply-to recipients))) ;; Perhaps "Mail-Copies-To: never" removed the only address? (if (string-equal recipients "") diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 65349ea18..8e789dd06 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -1890,7 +1890,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." ;; To or From header ((and (equal header 'to-from) (or (string-match (cadr regexp-target-pair) from) - (and (string-match message-dont-reply-to-names from) + (and (string-match (message-dont-reply-to-names) from) (string-match (cadr regexp-target-pair) to)))) (setq target (format-time-string (caddr regexp-target-pair) date))) ((and (not (equal header 'to-from)) diff --git a/texi/ChangeLog b/texi/ChangeLog index d07c89453..5ac5d3924 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,8 @@ +2006-05-30 Didier Verna + + * message.texi (Wide Reply): Update documentation of + message-dont-reply-to-names (now allowing a list of regexps). + 2006-05-29 Katsumi Yamaoka * gnus.texi (Saving Articles): Addition. diff --git a/texi/message.texi b/texi/message.texi index c73dabfce..29a2a2dc4 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -178,7 +178,8 @@ but you can change the behavior to suit your needs by fiddling with the @vindex message-dont-reply-to-names Addresses that match the @code{message-dont-reply-to-names} regular -expression will be removed from the @code{Cc} header. +expression (or list of regular expressions) will be removed from the +@code{Cc} header. A value of @code{nil} means exclude your name only. @vindex message-wide-reply-confirm-recipients If @code{message-wide-reply-confirm-recipients} is non-@code{nil} you -- 2.25.1