From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/43642 Path: quimby.gnus.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: [patch] hierarchical lists in message.el Date: Mon, 25 Feb 2002 18:04:25 -0500 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Message-ID: References: NNTP-Posting-Host: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: quimby2.netfonds.no 1014678601 2807 195.204.10.66 (25 Feb 2002 23:10:01 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 25 Feb 2002 23:10:01 GMT Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16fUFs-0000j0-00; Tue, 26 Feb 2002 00:10:00 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16fUBJ-0005xm-00; Mon, 25 Feb 2002 17:05:17 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 25 Feb 2002 17:05:17 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id RAA16776 for ; Mon, 25 Feb 2002 17:05:03 -0600 (CST) Original-Received: (qmail 2077 invoked by alias); 25 Feb 2002 23:04:58 -0000 Original-Received: (qmail 2072 invoked from network); 25 Feb 2002 23:04:58 -0000 Original-Received: from liilmtlssm01.mailtask.com (208.203.59.25) by gnus.org with SMTP; 25 Feb 2002 23:04:58 -0000 Original-Received: from onyx.nimbus.northernlight.com ([10.128.22.65]) by LIILMTLSSM01.mailtask.com with Microsoft SMTPSVC(5.0.2195.3779); Mon, 25 Feb 2002 17:04:31 -0600 Original-To: ding@gnus.org X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Followup-To: ding@gnus.org In-Reply-To: (prj@po.cwru.edu's message of "Fri, 01 Feb 2002 22:37:39 -0500") Original-Lines: 28 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i386-redhat-linux-gnu) X-OriginalArrivalTime: 25 Feb 2002 23:04:31.0465 (UTC) FILETIME=[C8905D90:01C1BE50] Precedence: list X-Majordomo: 1.94.jlt7 Xref: quimby.gnus.org gmane.emacs.gnus.general:43642 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:43642 --=-=-= I got the patch working and tested it today. It worked fine for me. It does something only when message-hierarchical-lists is defined, on replying to a message. Thanks again to Paul and Kai. I am attaching the patch again; it worked against this morning's CVS Gnus. It being the first patch I've done for Gnus, I don't know if it should go to the list or to someone in particular. Paul Jarc wrote: > Ted Zlatanov wrote: >> Also, the message-hierarchical-lists should probably be generalized to >> regular expressions for both the primary and secondary lists >> (message-hierarchical-lists-regexps?). I don't need this personally, >> but perhaps someone else will find it useful. > > That would complicate the code; the two uses of assoc would have to be > replaced by explicit iteration and regexp comparison. We could wait > for someone to ask for it, if it really is ever useful. You're right, no one has been clamoring for this feature as it is. Thanks Ted --=-=-= Content-Disposition: attachment; filename=message-hierarchical-patch --- 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))))) --=-=-=--