Thread View: news.software.readers
2 messages
2 total messages
Started by Dan_Jacobson
Thu, 05 Sep 1991 23:29
Re: KILL, unsubscribe, mail
Author: Dan_Jacobson
Date: Thu, 05 Sep 1991 23:29
Date: Thu, 05 Sep 1991 23:29
161 lines
6207 bytes
6207 bytes
>>>>> On 4 Sep 91 07:03:58 GMT, danlip@cco.caltech.edu (Daniel Adam Lipofsky) said:
DanLip> 1) I've been making lots of little KILL files all over the place using
DanLip> the K command in rn. They are annoying because they are buried down
DanLip> in multilple sub-directories.
GNUS can also let you have a kill file in your .emacs file. Sample:
;;KILL files equivalent
(setq
gnus-Apply-kill-hook
(function
(lambda ()
(cond
((string-equal gnus-newsgroup-name "chi.places")
(progn
(gnus-kill "Subject" "^Buzz .*Current Events")
(gnus-expunge "X")))
((string-equal gnus-newsgroup-name "chi.weather")
(progn
(gnus-Subject-sort-by-date t) ;well, if interactive
(gnus-kill "Subject" "Rockford\\|Indiana\\|Peoria\\|nearshore")
;;(gnus-expunge "X")
))
;;; special case
((string-match "^ih\\.\\|^att\\.\\|^chi\\." gnus-newsgroup-name)
(progn
(gnus-kill "Subject" "\\(bulls\\|hawks\\|cub\\|sox\\).*ticket")
(gnus-kill
"Subject"
"\\(\\<\\(land\\|car\\|motorcycle\\|home\\|house\\|tires\\|room\\|waterbed\\|sedan\\|condo\\|lot\\|truck\\|van\\|camper\\|boat\\|canoe\\)\\>\\).*\\(for\\|to\\).*\\(sale\\|rent\\|sublet\\)\\|\\3.*\\4:.*\\1")
(gnus-kill "Subject" "open.*house"))
);;; (gnus-expunge "X")))
((string-equal gnus-newsgroup-name "comp.emacs")
(progn
(gnus-kill "Subject" "MicroEmacs")
(gnus-kill "Subject" "Micro-Emacs")
(gnus-expunge "X")))
Fun, huh?
Here's the FTP pointer:
GNU Emacs Lisp Code Directory Apropos -- "gnus"
gnus (3.13) 90-03-01
Masanobu Umeda, <umerin@mse.kyutech.ac.jp>
archive.cis.ohio-state.edu:/pub/gnu/emacs/elisp-archive/packages/gnus-3.13.tar.Z
Net News Reader, Rn + vn with NNTP.
I also have a shell script that will turn your million KILL files
pretty much into the above style single stretch of GNU Emacs lisp.
OK, here it is.
#! /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@ihlpz on Fri Mar 8 18:20:10 1991
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'\" \(2178 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 3.13)
X#gnus-Apply-kill-hook examples to make the output. I am no lisp pro.
X#It does make (disk) blocks and blocks of KILL files into just a few
X#lines of lisp. Note GNUS 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
X#really should say "function (lambda () " instead of "'(lambda" below
X#[3/1991 -DJ]
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 2178 -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
Re: KILL, unsubscribe, mail
Author: Kevin Maurice Hudson
Date: Tue, 10 Sep 1991 22:01
Date: Tue, 10 Sep 1991 22:01
26 lines
1988 bytes
1988 bytes
>>>>> On 4 Sep 91 07:03:58 GMT, danlip@cco.caltech.edu (Daniel Adam
>>>>> Lipofsky) said:
DanLip> 1) I've been making lots of little KILL files all over the place
DanLip> using the K command in rn. They are annoying because they are
DanLip> buried down in multilple sub-directories.
==> On 5 Sep 91 23:29:40 GMT, Dan_Jacobson@ATT.COM suggested:
A very good way of combining kill files.
You should also be able to have a global kill file in your News
directory. This file is a elisp file and uses a similar format, but is
contained in a seperate file from your .emacs (which can get cluttered
without the added code of gnus-apply-kill-hook). It is also much easier
to edit quickly.
--
Kevin Hudson (Kevin Hudson)
hudson@dragon.cpe.ulowell.edu Dis-clamor: QUIET !!!!!!!
USnail "We do well to celebrate, for we
430 Broadway St. #8 can do nothing with sorrow"
Lowell, MA 01854 _Mirror of Her Dreams_
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads