home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / unix_c / usenet / rnmacros.sh < prev    next >
Text File  |  1989-03-21  |  3KB  |  70 lines

  1. 19-Sep-85 13:29:56-MDT,3094;000000000001
  2. Return-Path: <unix-sources-request@BRL.ARPA>
  3. Received: from BRL-TGR.ARPA by SIMTEL20.ARPA with TCP; Thu 19 Sep 85 13:29:48-MDT
  4. Received: from usenet by TGR.BRL.ARPA id a006005; 18 Sep 85 19:41 EDT
  5. From: Glenn Reid <greid@adobe.uucp>
  6. Newsgroups: net.sources
  7. Subject: Great tool for pre-processing KILL files with 'rn'
  8. Message-ID: <676@adobe.UUCP>
  9. Date: 16 Sep 85 20:03:16 GMT
  10. Keywords: rn KILL fun
  11. To:       unix-sources@BRL-TGR.ARPA
  12.  
  13. --------------------- cut here ---------------------
  14. # Startup macros for 'rn'.  Should reside in the file ".rnmac"
  15. # in your home directory (or your DOT directory, if you do it 
  16. # that way).  These macros allow pre-processing of KILL files,
  17. # among other things.
  18.  
  19. # Glenn Reid {glacier,decwrl}!adobe!greid  Mon Sep 16 12:56:23 1985
  20.  
  21. # This is best invoked by running 'rn' and piping the letter 'z'
  22. # into the thing until it pukes:
  23. #    yes z | rn    >& /dev/null
  24.  
  25. # The idea is that by always typing 'z', you will always enter each
  26. # newsgroup that has unread news (which will cause the KILL file to
  27. # be processed for that group), but will exit immediately after that,
  28. # and then duck into the next newsgroup.  This will continue until
  29. # the last newsgroup is entered and exited, at which point you will
  30. # quit 'rn'.  The point of having the 'z' key do all these different
  31. # things is so that you don't have to pay attention to where you are,
  32. # and you can use the above-mentioned command line to process the KILL
  33. # files *before* you read the news, so you save lots of search time.
  34.  
  35. # I originally intended this to be run in the background at some
  36. # random time, so that I would never have to know about the KILLed
  37. # articles, but I have discovered that is great fun to just type:
  38. #    yes | rn
  39. # and watch the thing cycle through the newsgroups, blowing away all
  40. # those hated articles.  In fact, it is arguably much more fun than
  41. # actually reading the news.
  42.  
  43. # NOTE: These macro names are ridiculous and are chosen
  44. #    so that they do not conflict with any standard 'rn' bindings.
  45. #    The 'driver' macro is the 'z' macro (last here), and you should
  46. #    really start reading there, since it calls the other macros as
  47. #    necessary.
  48.  
  49.  # the '*' macro is called by 'Z', quits if last newsgroups, otherwise 'y'..
  50.  # the condition %C=$ returns TRUE if the current newsgroup (in dot mode)
  51.  # is the last newsgroup (i.e. "End of newsgroups--what next? [npq]")
  52.  
  53. *    %(%C=$?q:y)
  54.  
  55.  # the 'Z' macro is called by 'z', calls '*' if there are unread articles...
  56.  # the %u=0 condition returns TRUE if there are no 'unread articles' in
  57.  # the current newsgroup.
  58.  
  59. Z    %(%u=0?q:^(*^))
  60.  
  61.  # the 'z' macro returns 'q' in any mode other than newsgroup selection mode,
  62.  # wherein it calls the 'Z' macro...
  63.  # the %m!=n means: "if mode is not 'newsgroup selection' mode"
  64.  # the ? clause is executed if condition is TRUE, the : clause otherwise
  65.  # the godawful ^( ^) syntax is required by 'rn' to be able to call a
  66.  # macro by name on the right-hand side of another macro.  Otherwise no
  67.  # expansion is done.
  68.  
  69. z    %(%m!=n?q:^(Z^))
  70.