Dan_Jacobson@ATT.COM (10/09/90)
[previous three postings didn't make it to the network] Archive-name: rnKILL2gnus #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # The tool that generated this appeared in the comp.sources.unix newsgroup; # send mail to comp-sources-unix@uunet.uu.net if you want that tool. # Contents: rnKILL2gnus # Wrapped by danj1@ihlpa on Sat Sep 29 19:43:41 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH echo If this archive is complete, you will see the following message: echo ' "shar: End of archive."' if test -f 'rnKILL2gnus' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'rnKILL2gnus'\" else echo shar: Extracting \"'rnKILL2gnus'\" \(2083 characters\) sed "s/^X//" >'rnKILL2gnus' <<'END_OF_FILE' X: Dan_Jacobson@ATT.COM 9/1990 X#real simple program that reads a tree of "rn" newsreader KILL files X#and spits out "gnus-Apply-kill-hook" lisp code for use in the GNUS newsreader X#(a subsystem of GNU Emacs). Sample ("more" output): X X# :::::::::::::: X# rec/food/veg/KILL X# :::::::::::::: X# THRU 4429 X# /recipe/j X# /cookbook/j X# :::::::::::::: X# rec/travel/KILL X# :::::::::::::: X# THRU 11021 X# /car rental/j X# /renting a car/j X#[...] X X#becomes X X# (setq gnus-Apply-kill-hook X# '(lambda () X# (cond X# ((string-equal gnus-newsgroup-name "rec.food.veg") X# (progn X# (gnus-kill "Subject" "recipe") X# (gnus-kill "Subject" "cookbook") X# (gnus-expunge "X"))) X# ((string-equal gnus-newsgroup-name "rec.travel") X# (progn X# (gnus-kill "Subject" "car rental") X# (gnus-kill "Subject" "renting a car") X# (gnus-expunge "X"))) X#[...] X X#You probably want to put that lisp code into your gnus-Startup-hook. X#Assumes: that your rn KILL files are all simple "/bla bla/j" kind of X#lines, that your $HOME/News tree has files like alt/wax/KILL (from X#rn's "-/" option), not e.g., alt.wax/KILL. Naturally double check X#the output. I just used Masanobu Umeda's gnus-Apply-kill-hook X#examples to make the output. I am no lisp pro. It does make (disk) blocks X#and blocks of KILL files into just a few lines of lisp. Note GNUS X#also has KILL files if you want them. X X#Took only 1/2 hour to whip up. And I've already processed my KILL X#files, so, er... I don't plan to enhance/fix/maintain this program. X#Today is also my first day messing with GNUS kill code. X Xset -e Xcd $HOME/News #or wherever your personal news tree is at Xecho "(setq gnus-Apply-kill-hook X '(lambda () X (cond" Xfor i in `find . -name KILL -print|sort`; do echo XXXX $i; cat $i; done| Xsed ' X/^XXXX/{ X1!i\ X (gnus-expunge "X"))) X Xs/^XXXX ..// Xs/.KILL$// Xs#/#.#g Xs/^/ ((string-equal gnus-newsgroup-name "/ Xs/$/")/ Xa\ X (progn X Xn X} X/^THRU/d Xs#^/# (gnus-kill "Subject" "# Xs#/[^/][^/]*$#")# X$a\ X (gnus-expunge "X")))))) X' X#funny: had to put "/^THRU/d" near the end to avoid sed bug[?] END_OF_FILE if test 2083 -ne `wc -c <'rnKILL2gnus'`; then echo shar: \"'rnKILL2gnus'\" unpacked with wrong size! fi chmod +x 'rnKILL2gnus' # end of 'rnKILL2gnus' fi echo shar: End of archive. exit 0 -- Dan_Jacobson@ATT.COM Naperville IL USA +1 708-979-6364