home *** CD-ROM | disk | FTP | other *** search
- : Dan_Jacobson@ATT.COM 9/1990
- #real simple program that reads a tree of "rn" newsreader KILL files
- #and spits out "gnus-Apply-kill-hook" lisp code for use in the GNUS newsreader
- #(a subsystem of GNU Emacs). Sample ("more" output):
-
- # ::::::::::::::
- # rec/food/veg/KILL
- # ::::::::::::::
- # THRU 4429
- # /recipe/j
- # /cookbook/j
- # ::::::::::::::
- # rec/travel/KILL
- # ::::::::::::::
- # THRU 11021
- # /car rental/j
- # /renting a car/j
- #[...]
-
- #becomes
-
- # (setq gnus-Apply-kill-hook
- # '(lambda ()
- # (cond
- # ((string-equal gnus-newsgroup-name "rec.food.veg")
- # (progn
- # (gnus-kill "Subject" "recipe")
- # (gnus-kill "Subject" "cookbook")
- # (gnus-expunge "X")))
- # ((string-equal gnus-newsgroup-name "rec.travel")
- # (progn
- # (gnus-kill "Subject" "car rental")
- # (gnus-kill "Subject" "renting a car")
- # (gnus-expunge "X")))
- #[...]
-
- #You probably want to put that lisp code into your gnus-Startup-hook.
- #Assumes: that your rn KILL files are all simple "/bla bla/j" kind of
- #lines, that your $HOME/News tree has files like alt/wax/KILL (from
- #rn's "-/" option), not e.g., alt.wax/KILL. Naturally double check
- #the output. I just used Masanobu Umeda's gnus-Apply-kill-hook
- #examples to make the output. I am no lisp pro. It does make (disk) blocks
- #and blocks of KILL files into just a few lines of lisp. Note GNUS
- #also has KILL files if you want them.
-
- #Took only 1/2 hour to whip up. And I've already processed my KILL
- #files, so, er... I don't plan to enhance/fix/maintain this program.
- #Today is also my first day messing with GNUS kill code.
-
- set -e
- cd $HOME/News #or wherever your personal news tree is at
- echo "(setq gnus-Apply-kill-hook
- '(lambda ()
- (cond"
- for i in `find . -name KILL -print|sort`; do echo XXXX $i; cat $i; done|
- sed '
- /^XXXX/{
- 1!i\
- (gnus-expunge "X")))
-
- s/^XXXX ..//
- s/.KILL$//
- s#/#.#g
- s/^/ ((string-equal gnus-newsgroup-name "/
- s/$/")/
- a\
- (progn
-
- n
- }
- /^THRU/d
- s#^/# (gnus-kill "Subject" "#
- s#/[^/][^/]*$#")#
- $a\
- (gnus-expunge "X"))))))
- '
- #funny: had to put "/^THRU/d" near the end to avoid sed bug[?]
-