From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87592 Path: news.gmane.org!.POSTED!not-for-mail From: Tim Landscheidt Newsgroups: gmane.emacs.gnus.general Subject: Re: how to make gnus print various group lists to stdout Date: Tue, 20 Jun 2017 01:39:21 +0000 Organization: http://www.tim-landscheidt.de/ Message-ID: <87h8zb5tfa.fsf@passepartout.tim-landscheidt.de> References: <86vanr7ei7.fsf@local.lan> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1497922824 21774 195.159.176.226 (20 Jun 2017 01:40:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Jun 2017 01:40:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+m35806@lists.math.uh.edu Tue Jun 20 03:40:14 2017 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from mxfilter-048034.atla03.us.yomura.com ([107.189.48.34]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dN89N-000539-IT for ding-account@gmane.org; Tue, 20 Jun 2017 03:40:13 +0200 X-Yomura-MXScrub: 1.0 Original-Received: from lists1.math.uh.edu (unknown [129.7.128.208]) by mxfilter-048034.atla03.us.yomura.com (Halon) with ESMTPS id 68f92242-5559-11e7-8ed1-b499baa2b07a; Tue, 20 Jun 2017 01:40:16 +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 1dN88q-0006Dn-Ko; Mon, 19 Jun 2017 20:39:40 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dN88m-0006D7-TH for ding@lists.math.uh.edu; Mon, 19 Jun 2017 20:39:37 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1dN88l-0008Jk-Bh for ding@lists.math.uh.edu; Mon, 19 Jun 2017 20:39:36 -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 1dN88j-0008PE-Vt for ding@gnus.org; Tue, 20 Jun 2017 03:39:34 +0200 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dN88d-0002zn-77 for ding@gnus.org; Tue, 20 Jun 2017 03:39:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-Lines: 38 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:CAOqFwCvMwGtfy4cf+oWT7BDaOQ= List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87592 Archived-At: Harry Putnam wrote: > […] > But only the elisp adepts among us are able to get that infomation in > a form amenable to scripting with other tools (Perl I have in mind but > there are. of course, many others.) > For some of what I'm fiddling with it would be very handy to have some > of that information available on STDOUT. > 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: | (dolist (group gnus-newsrc-alist) | (insert (format "%s\n" (car group)))) 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. The lack of documentation can be a bit daunting (and of course you should make sure you have backups in case you ac- cidentally set one of those Gnus variables with setq & Co.), but for throw-away lists I think generating them from within Gnus is much preferable. Tim