From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18587 Path: news.gmane.org!.POSTED!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.gnus.user Subject: Anyone have elisp to unwind the agent groups list Date: Thu, 01 Jun 2017 23:19:38 -0400 Organization: Still searching... Message-ID: <86o9u7oyu7.fsf@local.lan> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1496374021 25390 195.159.176.226 (2 Jun 2017 03:27:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Jun 2017 03:27:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Fri Jun 02 05:26:57 2017 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGdEn-0006OL-6a for gegu-info-gnus-english@m.gmane.org; Fri, 02 Jun 2017 05:26:57 +0200 Original-Received: from localhost ([::1]:47687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGdEs-00044p-K3 for gegu-info-gnus-english@m.gmane.org; Thu, 01 Jun 2017 23:27:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGdEH-000400-VW for info-gnus-english@gnu.org; Thu, 01 Jun 2017 23:27:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGdDO-0007mb-4R for info-gnus-english@gnu.org; Thu, 01 Jun 2017 23:26:25 -0400 Original-Received: from [195.159.176.226] (port=42259 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dGdDN-0007kx-I7 for info-gnus-english@gnu.org; Thu, 01 Jun 2017 23:25:29 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dGdDE-0001zF-03 for info-gnus-english@gnu.org; Fri, 02 Jun 2017 05:25:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 59 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:dyjaACOj8d9u1bUu4p4nKwMZC3c= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: "info-gnus-english" Xref: news.gmane.org gmane.emacs.gnus.user:18587 Archived-At: Wondering if anyone has a code snippet that unwinds the list of groups under the agent; accessable at `J C' (opens the agent buffer) press `g' on the predicate of choice (press `p' if you need to see all or your predicates) And up pops a list of groups all on one line. If you have more than 3 or 4 it can be a bit taxing to read thru the list. Since I'm a starkly illiterate elisper I wrote a primitive perl script to do it... but wondered if any of you might have a snippet you've kept that does that from gnus. Being elisp challenged, I am rarely able to contribute here. So, even at rist of being stoned by the perl community, I offer my sorry little perl script that can be run against that list using the `alt-shift |' command. (shell-command-on-region) ------- ------- ---=--- ------- ------- #!/usr/bin/perl # Keywords: unwind_agent_groups # Keydate: 170601_192930 4 # # Usage: `unwind_agent_groups' [Used in a pipe inside emacs/gnus] # use strict; use warnings; my ($myscript) = $0 =~ m{([^/]+)$}; my $usage = " Purpose: print out agent groups in a list, one per line Usage: `$myscript' [expected to be used in a pipe] inside emacs/gnus in J C buffer "; if (@ARGV){ if ($ARGV[0] eq "help") { warn "$usage\n"; exit; } } my (@a, $parenless); while (<>) { if (/\(/) { ($parenless) = $_ =~ m/[(]["](.*)["][)]$/; @a = split(/"\s+"/,$parenless); } } my $cnt = 0; for (sort @a) { $cnt++; printf "%4d%s %s\n", $cnt,":",$_; }