From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87593 Path: news.gmane.org!.POSTED!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.gnus.general Subject: Re: how to make gnus print various group lists to stdout Date: Mon, 19 Jun 2017 23:37:40 -0400 Organization: Still searching... Message-ID: <86injr72ij.fsf@local.lan> References: <86vanr7ei7.fsf@local.lan> <87h8zb5tfa.fsf@passepartout.tim-landscheidt.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1497929922 26438 195.159.176.226 (20 Jun 2017 03:38:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Jun 2017 03:38:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+m35807@lists.math.uh.edu Tue Jun 20 05:38:37 2017 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from mxfilter-048035.atla03.us.yomura.com ([107.189.48.35]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dN9zw-0006RG-97 for ding-account@gmane.org; Tue, 20 Jun 2017 05:38:36 +0200 X-Yomura-MXScrub: 1.0 Original-Received: from lists1.math.uh.edu (unknown [129.7.128.208]) by mxfilter-048035.atla03.us.yomura.com (Halon) with ESMTPS id f2a7da61-5569-11e7-b087-b499baabecb2; Tue, 20 Jun 2017 03:38:39 +0000 (UTC) Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.87) (envelope-from ) id 1dN9zI-00078H-Vp; Mon, 19 Jun 2017 22:37:57 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dN9zF-00077U-0z for ding@lists.math.uh.edu; Mon, 19 Jun 2017 22:37:53 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1dN9zD-0003us-IZ for ding@lists.math.uh.edu; Mon, 19 Jun 2017 22:37:52 -0500 Original-Received: from [195.159.176.226] (helo=blaine.gmane.org) by quimby.gnus.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1dN9z9-0001Ta-S4 for ding@gnus.org; Tue, 20 Jun 2017 05:37:47 +0200 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dN9z2-0003lo-GI for ding@gnus.org; Tue, 20 Jun 2017 05:37:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 59 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:wf69E8Nl3bWLdHff0diy6pri3E4= List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87593 Archived-At: Tim Landscheidt writes: >> Can anyone offer some ways to get at that kind of information other >> than viewing it inside emacs, and creating a file from the buffer? > > You can parse ~/.newsrc.eld with Perl, and apparently there > is even a CPAN module for reading Lisp (Data::SExpression), > but I would rather bite the bullet and learn some (basic) > Emacs Lisp. For example, after starting Gnus, if you switch > to an empty buffer and evaluate: First, thanks for the great input. That was exactly the point of my post.. to do it with gnus.. the But make gnus write the info to files or stdout. `other' tools come in after getting the basic group info from gnus. I've been parsing .newsrc.eld or trying to, but I found a file that shows all the agentized groups in a simpler setting: News/agent/lib/categories. Since the only category I use is `true' and make it the default, then that is all that is in there so fairly easy to pull the group names out of there with perl. Still need access to other of gnus group lists though, which is in .newsrc.eld. > | (dolist (group gnus-newsrc-alist) > | (insert (format "%s\n" (car group)))) Yup... I see, and is exactly what I was asking about. > you get a list of all groups. If you use: > > | (dolist (group gnus-newsrc-alist) > | (if (equal (nth 4 group) '(nntp "news.gmane.org")) > | (insert (format "%s\n" (car group))))) > you get a list of all groups for Gmane. This second one looks like it could be edited to make it produce a list from any foreign groups too. I'm curious what the `nth 4 group' is all about... is it a reference to level 4? Also I should say that the second example does nothing here.. well it prints `nil' when evaluated with C-x C-e I do have gmane in ~/.gnus like this: (setq gnus-select-method '(nntp "news.gmane.org")) Oh, and how would I go about making emacs/gnus send any list information to stdout or to file?