--- message-original.el Fri Feb 1 16:07:38 2002 +++ message.el Fri Feb 1 17:11:14 2002 @@ -1044,6 +1044,15 @@ :type '(choice (const :tag "Always use primary" nil) regexp)) +(defcustom message-hierarchical-lists nil + "A list of hierarchical mailing list definitions. + +Inside each entry, the first address is the top list, everything after +it are secondary addresses contained in the list. The secondaries +will be removed from the list of recipients when mail is prepared for +delivery." + :group 'message-headers) + (defcustom message-mail-user-agent nil "Like `mail-user-agent'. Except if it is nil, use Gnus native MUA; if it is t, use @@ -4512,6 +4521,23 @@ (let ((s recipients)) (while s (setq recipients (delq (assoc (car (pop s)) s) recipients)))) + + ;; remove hierarchical lists that are contained within each other, + ;; if message-hierarchical-lists is defined + (when message-hierarchical-lists + (let* ((plain-addrs (mapcar 'car recipients)) + sublists recip) + (while plain-addrs + (setq sublists (assoc (car plain-addrs) message-hierarchical-lists) + plain-addrs (cdr plain-addrs)) + (when sublists + (setq sublists (cdr sublists)) + (while sublists + (setq recip (assoc (car sublists) recipients) + sublists (cdr sublists)) + (if recip + (setq recipients (delq recip recipients)))))))) + ;; Build the header alist. Allow the user to be asked whether ;; or not to reply to all recipients in a wide reply. (setq follow-to (list (cons 'To (cdr (pop recipients)))))