From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/42846 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.emacs.gnus.general Subject: Re: possible strange idea about hierarchical lists Date: Thu, 31 Jan 2002 16:40:10 -0500 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035178034 14382 80.91.224.250 (21 Oct 2002 05:27:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:27:14 +0000 (UTC) Return-Path: Original-Received: (qmail 8858 invoked from network); 31 Jan 2002 21:43:11 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 31 Jan 2002 21:43:11 -0000 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 16WOxH-00011O-00; Thu, 31 Jan 2002 15:41:15 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 31 Jan 2002 15:41:01 -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 PAA02546 for ; Thu, 31 Jan 2002 15:40:14 -0600 (CST) Original-Received: (qmail 8645 invoked by alias); 31 Jan 2002 21:40:12 -0000 Original-Received: (qmail 8640 invoked from network); 31 Jan 2002 21:40:11 -0000 Original-Received: from multivac.student.cwru.edu (HELO multivac.cwru.edu) (qmailr@129.22.96.25) by gnus.org with SMTP; 31 Jan 2002 21:40:11 -0000 Original-Received: (qmail 29608 invoked by uid 500); 31 Jan 2002 21:40:32 -0000 Original-To: ding@gnus.org In-Reply-To: (Ted Zlatanov's message of "Wed, 16 Jan 2002 14:33:38 -0500") Mail-Copies-To: nobody Mail-Followup-To: ding@gnus.org Original-Lines: 39 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/20.7 (i386-redhat-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:42846 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:42846 Ted Zlatanov wrote: > (let* ((recipients '(("foo@bar" . "Name ") ("baz@quux" . "None "))) > (s recipients) > (gnus-hierarchical-lists '( ("foo@bar" . "baz@quux")))) > (while gnus-hierarchical-lists > (let* ((node (pop gnus-hierarchical-lists)) > (parent (car node)) > (child (cdr node))) > (when (and (assoc parent recipients) (assoc child recipients)) > (delq parent recipients))))) How about this: (let* ((recipients '(("foo@bar" . "Name ") ("baz@quux" . "None "))) (plain-addrs (mapcar 'car recipients)) (gnus-hierarchical-lists '(("baz@quux" "foo@bar"))) sublists recip) (while plain-addrs (setq sublists (assoc (car plain-addrs) gnus-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))))))) Note that this is a different structure for gnus-hierarchical-lists. An entry (A B C) means that A contains B and C. (No further relationship between B and C is implied.) So if A appears in the recipient list, then B and C will be removed from it, if present. If B and C have sublists of their own, they should get their own top-level entries in gnus-hierarchical-lists. In this case, gnus-hierarchical-lists says that messages to baz@quux also go to foo@bar, so foo@bar is removed from the recipient list. paul