home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / rn-comments / part01 / RNPREJUDICE < prev    next >
Encoding:
Text File  |  1990-09-15  |  3.9 KB  |  89 lines

  1. ABOUT RNPREJUDICE
  2.  
  3. The rnprejudice patch is intended to solve the problem where you are looking
  4. at a news article and think, "Isn't that the person who said...?"  It allows
  5. you to have a file containing a set of entries, each of which consists of a
  6. person's address and an associated comment.  The comment is printed out
  7. under the From line of any article by that person.  So if someone posts
  8. something really stupid (or really clever) you can arrange for all their
  9. subsequent articles to be branded (or emblazoned) with your own personal
  10. prejudice against (or for) that person.
  11.  
  12. The modified rn looks in the RNPREJUDICE environment variable for the name
  13. of the prejudice file.  You can define this variable in your login script,
  14. or via the -E option to rn.
  15.  
  16. Lines in the prejudice file beginning with # are comments.  Unindented lines
  17. contain mail addresses which are checked against the From line of each
  18. article.  If a match is found, the indented lines following the match will
  19. be printed.  The From line must match exactly, i.e., the case of letters
  20. must be the same.  The parenthesised personal name is ignored in the match.
  21.  
  22. # Here is an example rnprejudice file.
  23. em@dce.ie
  24.     Author of rnprejudice patch
  25. emcmanus@cs.tcd.ie
  26.     Author of rnprejudice patch
  27. # If someone has multiple addresses, they must have multiple entries.
  28. questionable@severed-head.com
  29.     Believes that the Earth is flat, that skyscapers are the remnants of
  30.     a lost civilisation, and that Reagan wasn't so bad after all.
  31. BIFF@BIT.NET
  32.     Classic BIFF
  33.  
  34. In your .rnmac file you might define a macro like this:
  35. # Edit the rnprejudice file
  36. *    !echo '%t' >>$RNPREJUDICE; vi + $RNPREJUDICE\n
  37. This appends the e-mail address from the current article to the prejudice
  38. file and starts you up in the editor, where you can add the comment.  When
  39. you return from the edit, rn will notice that the file has been edited and
  40. read in the new copy.
  41.  
  42.  
  43. APPLYING THE PATCH
  44.  
  45. In the rn source directory, feed the file RNPREJ.PATCH to the patch program.
  46. This makes a small change to art.c so that it calls a function to look up
  47. the From line of an article after displaying it, and modifies the Makefile
  48. to know about the new files checkfrom.c, stb.c, and stb.h.  Because the
  49. changes are so small, they should work with most versions of rn.  The patch
  50. was derived from version 4.3.2.2, patchlevel 44.
  51.  
  52. "make rn" should recompile rn without problems.  If the new files fail to
  53. compile, mail me <em@dce.ie> with a description of the problem.
  54.  
  55.  
  56. IMPLEMENTATION NOTES
  57.  
  58. Since the prejudice entries are kept entirely in memory, the patched rn
  59. probably won't run on machines with small address spaces.
  60.  
  61. The in-memory data are handled by the code in stb.c.  This uses a binary
  62. tree for each possible initial letter.  If you keep your rnprejudice file
  63. in alphabetical order, performance will be bad.  A hash table might be
  64. better, but I wanted to avoid a big overhead when the prejudice file is
  65. small.  (In my experience it grows pretty quickly, though.)  It would be
  66. easy to replace this file with a different implementation.
  67.  
  68. There are some things that could be improved:
  69. * Lookups should not be case-sensitive, at least for the domain portion of
  70.   the address.  The addresses in people's postings tend to show up with
  71.   consistent case however.
  72. * It would be convenient if you could have different aliases for the same
  73.   person, rather than having to enter the same prejudice multiple times as
  74.   at present.  Each block of unindented lines could be taken as a set of
  75.   addresses for the same person.
  76. * It might be better to look up the name in the parenthesised comment instead
  77.   of or as well as the mail address.
  78. * If you change the RNPREJUDICE environment variable within rn (using &-E)
  79.   the code does not notice.  This could be fixed, but I don't see any need
  80.   at present.
  81.  
  82.  
  83. STATUS
  84.  
  85. This patch is by Eamonn McManus, Datacode Communications Ltd <em@dce.ie>.
  86. It is not copyrighted and may be used freely.
  87.  
  88. $Id: RNPREJUDICE,v 1.1 90/09/11 23:01:34 em Exp $
  89.