🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.emacs
Article #8383

perl code to format Directory (was Re: GNU Emacs Lisp Code Directory)

#8383
From: Randal L. Schwartz Stonehenge
Date: Thu, 26 Jan 1989 16:51
65 lines
2967 bytes
In article <35090@bbn.COM>, dsill@RELAY-NSWC writes:
| Here's the latest version of my datafile of GNU Emacs Lisp code and
| GNU Emacs modifications that have been posted to one of the
| Emacs-related mailing lists.  The are now over 170 entries.
| 
| In case you missed my December postings, I'm now distributing the
| directory as a datafile.  I previously posted a UNIX shell/awk script
| to produce a report similar to the earlier directories I posted.  If
| you don't have UNIX or a copy of the report generating script, drop me
| a line.
| 
| I've been hoping someone who Lisps would whup up an interface or
| report generator in GNU Lisp, but it hasn't happened yet.  Something
| like lisp-dir-apropos which would pop up a window with formatted info
| about matching entries would be nice, if anyone's listening....

Okay, so it isn't Elisp, but it is 'perl'.  Try the attached code.  It
wants the article saved in "NEWS-lib-list" with *nothing* between the
newsheader and the first entry (like you posted last time! :-).
Appropriate munging will be required to have "perl" located properly
and the filename changed if necessary.

Enjoy.

Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095
on contract to BiiN (for now :-), Hillsboro, Oregon, USA.
ARPA: <@iwarp.intel.com:merlyn@intelob.intel.com> (fastest!)
MX-Internet: <merlyn@intelob.intel.com> UUCP: ...[!uunet]!tektronix!biin!merlyn
Standard disclaimer: I *am* my employer!
Cute quote: "Welcome to Oregon... home of the California Raisins!"

====== cut here ====== no .signature at end (I hope) ======
#!/ba/merlyn/.bin/perl
open(F, "<NEWS-lib-list") || die;

format top =

============== Elisp Code Directory (posted: @<<<<<<<<<<<<<<<<<<<<<) =========
$postdate

.

format stdout =
Name: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... Version: ^<<<<<<<<<<<<...
$name $vers
Description: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... Date: ^<<<<<<<<<<<<<<<...
$desc $date
Contact: ^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>... (^<<<<<<<<<<<<<<<<<<<...)
$cont $auth

.

while (<F>) {
	last if /^$/;
	next unless /^Date:\s*(\S.+\S)\s*$/;
	$postdate = $1;
}

die if eof(F);

while (<F>) {
	next if /^Name.Author/;
	($name, $auth, $cont, $desc, $date, $vers) = split(/\|/);
	write;
}
Technical Details
Message-ID: <4090@omepd.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!blake!ogccse!littlei!omepd!merlyn
References: <35090@bbn.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!blake!ogccse!littlei!omepd!merlyn
From: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge)
Newsgroups: comp.emacs,gnu.emacs
Subject: perl code to format Directory (was Re: GNU Emacs Lisp Code Directory)
Summary: src attached
Keywords: GNU-ONLY
Message-ID: <4090@omepd.UUCP>
Date: 26 Jan 89 16:51:38 GMT
References: <35090@bbn.COM>
Sender: news@omepd.UUCP
Reply-To: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge)
Organization: Stonehenge; netaccess via BiiN, Hillsboro, Oregon, USA
Lines: 65
In-reply-to: dsill@RELAY-NSWC.NAVY.MIL