From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/39492 Path: main.gmane.org!not-for-mail From: Matt Armstrong Newsgroups: gmane.emacs.gnus.general Subject: Re: Generating Mail-Followup-To: headers Date: Fri, 19 Oct 2001 14:31:51 -0600 Sender: owner-ding@hpc.uh.edu Message-ID: <87k7xrmkw8.fsf@squeaker.lickey.com> References: <87y9m9fs6b.fsf@squeaker.lickey.com> <87elo1exsd.fsf@squeaker.lickey.com> <87u1wvkaiv.fsf@mclinux.com> <87bsj3fq0n.fsf@mclinux.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035175192 28252 80.91.224.250 (21 Oct 2002 04:39:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:39:52 +0000 (UTC) Return-Path: Original-Received: (qmail 12312 invoked from network); 19 Oct 2001 20:33:35 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 19 Oct 2001 20:33:35 -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 15ugJi-0002Mg-00; Fri, 19 Oct 2001 15:32:30 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 19 Oct 2001 15:32:06 -0500 (CDT) 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 PAA15886 for ; Fri, 19 Oct 2001 15:31:52 -0500 (CDT) Original-Received: (qmail 12295 invoked by alias); 19 Oct 2001 20:32:10 -0000 Original-Received: (qmail 12290 invoked from network); 19 Oct 2001 20:32:09 -0000 Original-Received: from hank.lickey.com (64.81.100.235) by gnus.org with SMTP; 19 Oct 2001 20:32:09 -0000 Original-Received: from squeaker.lickey.com (squeaker.lickey.com [192.168.100.10]) by hank.lickey.com (Postfix) with ESMTP id 3A8A3EDA7 for ; Fri, 19 Oct 2001 14:31:54 -0600 (MDT) Original-Received: from localhost (localhost [127.0.0.1]) by squeaker.lickey.com (Postfix) with ESMTP id 801F2BDFD for ; Fri, 19 Oct 2001 14:31:53 -0600 (MDT) Original-Received: by squeaker.lickey.com (Postfix, from userid 1000) id 41077BD4E; Fri, 19 Oct 2001 14:31:51 -0600 (MDT) Original-To: ding@gnus.org In-Reply-To: <87bsj3fq0n.fsf@mclinux.com> (Josh Huber's message of "Fri, 19 Oct 2001 14:23:04 -0400") Original-Lines: 46 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 X-Virus-Scanned: by AMaViS snapshot-20010714 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:39492 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:39492 Josh Huber writes: > take a look at this function I just whipped up: > > (defun gnus-find-subscribed-addresses () > (delete-if > nil (mapcar '(lambda (group) > (or (gnus-group-find-parameter group 'to-address) > (gnus-group-find-parameter group 'to-list))) > (delete-if-not '(lambda (group) > (gnus-group-find-parameter > group 'subscribed)) > (mapcar '(lambda (item) (car item)) > gnus-newsrc-alist))))) > > I'm pretty sure that I shouldn't be just accessing gnus-newsrc-alist > directly -- someone tell me what I should be doing. > > oh, and you'll need something like this: > > (setq gnus-parameters > '(("^mail\\.lists\\." (subscribed . t)))) Way cool! gnus-group-prepare-flat skips the first element of gnus-newsrc-alist (which appears to always be a dummy group). Besides that, it looks like that is the best way to get at all the group names. Here is the same thing in a procedural style that I can actually understand. :-) (defun gnus-find-subscribed-addresses () (let ((newsrc (cdr gnus-newsrc-alist)) group address list) (while newsrc (setq group (car (car newsrc)) newsrc (cdr newsrc)) (if (and (gnus-group-find-parameter group 'subscribed) (setq address (or (gnus-group-find-parameter group 'to-address) (gnus-group-find-parameter group 'to-list)))) (setq list (cons address list)))) list)) -- matt