home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / ca / general / 1599 next >
Encoding:
Internet Message Format  |  1992-12-21  |  11.7 KB

  1. Xref: sparky ca.general:1599 ba.general:5344
  2. Path: sparky!uunet!olivea!sun-barr!ames!data.nas.nasa.gov!amelia.nas.nasa.gov!eugene
  3. From: eugene@amelia.nas.nasa.gov (Eugene N. Miya)
  4. Newsgroups: ca.general,ba.general
  5. Subject: [l/m 6/1/92] Kill files . . . with extreme prejudice
  6. Message-ID: <1992Dec21.120117.28520@nas.nasa.gov>
  7. Date: 21 Dec 92 12:01:17 GMT
  8. Sender: news@nas.nasa.gov (News Administrator)
  9. Reply-To: eugene@amelia.nas.nasa.gov (Eugene N. Miya)
  10. Followup-To: poster
  11. Distribution: ca
  12. Organization: NAS Program, NASA Ames Research Center, Moffett Field, CA
  13. Lines: 299
  14.  
  15. Panel 21
  16.  
  17.     Table of Contents of this Chain
  18.  
  19. 21    Killfiles (with extreme prejudice)            <This panel>
  20. 28    Canceling posted news articles
  21. 1    Reminders on use of the *.general news.groups
  22. 7    General Help Reading News
  23. 14    Posting headers and cross-posting
  24. 15    Distribution Fields
  25.  
  26. Kill files:
  27.     or how to stop reading
  28.         1) people you don't like, or
  29.         2) dated FAQ postings you've already read, or
  30.         3) reading subjects you think dull, or
  31.         4) ...
  32.  
  33. Not all systems have Kill files.  I personally wish this could be more
  34. general, but I've failed trying to find better strategies, maybe you can write
  35. a better one?  This example uses the rn news reader, but similar commands
  36. can be found on other systems.  Ask your News admin.  Notably lacking is one
  37. for Notefile systems.  While the Kill command exists, it is crude with
  38. problems, and a best strategy or style is needed to surgerically remove
  39. unwanted messages, messengers, or 'bills.'
  40.  
  41. The best strategy appears to be
  42.     1) creat a Kill file
  43.     2) edit it
  44. Select a message/topic/person to terminate with extreme prejudice,
  45. The 'K' command creates a KILL file in your News directory structure which
  46. mimics the News hierarchy (e.g., News/ba/general); it looks like:
  47.  
  48. <BOF>
  49. THRU message#
  50. /search strings of articles to junk/j
  51. <EOF>
  52.  
  53. THRU is just a pointer: all messages checked to that point.  The search
  54. string is usually a portion of the Subject: field.  Next edit using
  55. ^K (control-K).  This places one in the editor (setenv using the EDITOR
  56. environment variable, vi is default).  Here you edit
  57. the search string for messages you wish to junk.  There is a search time
  58. cost associated prior to actually reading news, your key is editing this
  59. search string.  You can use '*' as the wildcard (glob, or Kleene star)
  60. character.  You can restrict the search to just message Headers or
  61. search a whole message.  Let's just restrict Headers:, add an 'h' before
  62. the 'j' for junk:
  63. /:fromstring/h:j or
  64. /:subjectstring/h:j
  65. Note the ':' in the string anchors the search to specific fields in the
  66. header body.  Collect and keep or delete j-lines.
  67.  
  68. So for instance, if you want to stop reading automated posting
  69. FAQ messages, you can K on one
  70. /: Welcome to*/h:j        # for many groups
  71. /: [l/m 8/16] Kill files*/h:j    # for this message
  72. /: *obnoxious*/h:j        # stop reading anything by obnoxious
  73. /: *eugene@*/h:j        # stop reading anything by me in that group
  74.  
  75. Disadvantages: as said by more than one person: sometimes you want to
  76. resume reading some one or thing.  This is where the l/m comes into the
  77. search field/ it allows you to stay current but avoid old messages. 
  78. Otherwise, you must take some time to edit Kill files.
  79.         This is the end.
  80.                     -- Jim Morrison
  81. SEE ALSO
  82.     kill(1).
  83.  
  84.  
  85.  
  86. Here's the information on Gnus. Edit as you wish.
  87.  
  88. (M-x is Meta-x or ESC <x>)
  89.  
  90. `M-k'
  91.      Edit a local KILL file applied to the current newsgroup
  92.      (`gnus-Subject-edit-local-kill').  *Note KILL File::, for more
  93.      information.
  94.  
  95. `M-K'
  96.      Edit a global KILL file applied to all newsgroups
  97.      (`gnus-Subject-edit-local-kill').  *Note KILL File::, for more
  98.      information.
  99.  
  100.  
  101. KILL File
  102. *********
  103.  
  104.   The purpose of a KILL file and its usage are described here.
  105.  
  106. * Menu:
  107.  
  108. * What KILL Files Do::          An introduction to a KILL file.
  109. * Making a KILL File::          How to make a KILL file.
  110. * Editing KILL Files::          How to edit KILL files.
  111. * Example of a KILL File::      An example of a KILL file.
  112.  
  113. * Background Kills::            Background kill processing.
  114. * Advanced Kills::              Advanced kill processing.
  115.  
  116.  
  117. What KILL Files Do
  118. ==================
  119.  
  120.   A "KILL" file contains lisp expressions to be applied to a selected
  121. newsgroup.  The purpose is to mark articles as read on the basis of some
  122. set of regexps.
  123.  
  124.   There are two kinds of KILL files, global and local.  A global KILL
  125. file is applied to every newsgroup, and a local KILL file to a specified
  126. newsgroup.  Since a global KILL file is applied to every newsgroup, for
  127. better performance use a local one.
  128.  
  129.  
  130. Making a KILL File
  131. ==================
  132.  
  133.   A KILL file can contain any kind of Emacs lisp expressions expected to
  134. be evaluated in the Subject buffer.  Writing lisp programs for this
  135. purpose is not easy because the internal working of GNUS must be
  136. well-known.  For this reason, GNUS provides a general function which
  137. does this easily for non-lisp programmers.
  138.  
  139.      (gnus-kill FIELD REGEXP &optional COMMAND ALL)
  140.  
  141. The `gnus-kill' function executes commands available in Subject Mode by
  142. their key sequences.  `gnus-kill' must be called with FIELD, REGEXP, and
  143. optional COMMAND and ALL.  FIELD is a string representing the header
  144. field or an empty string.  If FIELD is an empty string, the entire
  145. article body is searched for.  REGEXP is a string which is compared with
  146. FIELD value.  COMMAND is a string representing a valid key sequence in
  147. Subject Mode or a lisp expression.  COMMAND is default to
  148. `(gnus-Subject-mark-as-read nil "X")'.  Make sure that COMMAND is
  149. executed in the Subject buffer.  If the second optional argument ALL is
  150. non-`nil', the COMMAND is applied to articles which are already marked
  151. as read or unread.  Articles which are marked are skipped over by
  152. default.
  153.  
  154.   For example, if you want to mark articles of which subjects contain
  155. the string `AI' as read, a possible KILL file may look like:
  156.  
  157.      (gnus-kill "Subject" "AI")
  158.  
  159.   If you want to mark articles with `D' instead of `X', you can use the
  160. following expression:
  161.  
  162.      (gnus-kill "Subject" "AI" "d")
  163.  
  164. In this example it is assumed that the command
  165. `gnus-Subject-mark-as-read-forward' is assigned to `d' in Subject Mode.
  166.  
  167.   It is possible to delete unnecessary headers which are marked with `X'
  168. in a KILL file by using the function `gnus-expunge' as follows:
  169.  
  170.      (gnus-expunge "X")
  171.  
  172.   If the Subject buffer is empty after applying KILL files, GNUS will
  173. exit the selected newsgroup normally.  If headers which are marked with
  174. `D' are deleted in a KILL file, it is impossible to read articles which
  175. are marked as read in the previous GNUS sessions.  Marks other than `D'
  176. should be used for articles which should really be deleted.
  177.  
  178.   All sorts of searches in Subject Mode normally ignore the case of the
  179. text they are searching through.  If you do not want to ignore the case,
  180. set the variable `case-fold-search' to `nil'.
  181.  
  182.  
  183. Editing KILL Files
  184. ==================
  185.  
  186.   The command `M-K' in Subject Mode and Group Mode
  187. (`gnus-Subject-edit-global-kill' and `gnus-Group-edit-global-kill') pops
  188. up an Emacs buffer for editing a global KILL file.  A global KILL file
  189. is created in the directory specified by the variable
  190. `gnus-article-save-directory' (default to `~/News'), and its file name
  191. is specified by the variable `gnus-kill-file-name' (default to `KILL').
  192.  
  193.   The command `M-k' in Subject Mode and Group Mode
  194. (`gnus-Subject-edit-local-kill' and `gnus-Group-edit-local-kill') pops
  195. up an Emacs buffer for editing a local KILL file.  A local KILL file for
  196. a newsgroup NEWS.GROUP is created as `NEWS.GROUP.KILL' in the directory
  197. specified by the variable `gnus-article-save-directory' if the variable
  198. `gnus-use-long-file-name' is non-`nil'.  Otherwise, if the variable
  199. `gnus-use-long-file-name' is `nil', the file is created as
  200. `NEWS/GROUP/KILL' under the same directory.
  201.  
  202.   The major mode of these buffers is "KILL-File Mode".  This mode is
  203. specialized for editing Emacs lisp programs the same as Emacs-Lisp Mode.
  204. In addition to Emacs-Lisp Mode, the following commands are available:
  205.  
  206. `C-c C-k C-s'
  207.      Insert a template of a kill command on subject
  208.      (`gnus-Kill-file-kill-by-subject').
  209.  
  210. `C-c C-k C-a'
  211.      Insert a template of a kill command on author
  212.      (`gnus-Kill-file-kill-by-author').
  213.  
  214. `C-c C-a'
  215.      Apply current buffer being edited to selected newsgroup
  216.      (`gnus-Kill-file-apply-buffer').
  217.  
  218. `C-c C-e'
  219.      Apply sexp before point in current buffer to selected newsgroup
  220.      (`gnus-Kill-file-apply-last-sexp').
  221.  
  222. `C-c C-c'
  223.      Save the KILL file and then return to the previous buffer
  224.      (`gnus-Kill-file-exit').
  225.  
  226. `C-c C-i'
  227.      Read Info on KILL file (`gnus-Info-find-node').  *Note Texinfo
  228.      Manual::, to prepare an Info file of GNUS.
  229.  
  230.   If KILL-File Mode is invoked from Subject Mode by the command
  231. `gnus-Subject-edit-local-kill' or `gnus-Subject-edit-global-kill', the
  232. commands `C-c C-k C-s' and `C-c C-k C-a'
  233. (`gnus-Kill-file-kill-by-subject' and `gnus-Kill-file-kill-by-author')
  234. insert a kill command on the subject and author of an article where the
  235. point is on, respectively.  Otherwise, a template of a kill command is
  236. inserted.
  237.  
  238.   The commands `C-c C-a' and `C-c C-e' (`gnus-Kill-file-apply-buffer'
  239. and `gnus-Kill-file-apply-last-sexp') can be used to test kill commands
  240. being edited in current buffer.  The kill commands are applied to
  241. current newsgroup.
  242.  
  243. Example of a KILL File
  244. ======================
  245.  
  246.   The following is an example of a local KILL file for newsgroup
  247. `control'.  This is currently being used by the author.
  248.  
  249.      ;; Apply to the newsgroup `control' if the NNTP server is flab.
  250.      (if (string-equal gnus-nntp-server "flab")
  251.          (progn
  252.            (gnus-kill "Subject" "ihave flab\\|sendme")
  253.            (gnus-kill "Subject" "cancel\\|newgroup\\|rmgroup" "d")
  254.            (gnus-expunge "X")))
  255.  
  256.  
  257. Background Kill Processing
  258. ==========================
  259.  
  260.   Kill processing may take long time.  If it becomes terribly
  261. frustrating, try background kill processing using the following shell
  262. command:
  263.  
  264.      emacs -batch -l gnus -f gnus-batch-kill NEWSGROUPS
  265.  
  266. where NEWSGROUPS argument is newsgroup names separated by either white
  267. spaces or a comma.  `!' preceding a newsgroup name means negation, and
  268. `all' matches anything else.  These interpretations are the same as the
  269. options line of the startup file (*Note Startup File::).
  270.  
  271.  
  272. Advanced Kill Processing
  273. ========================
  274.  
  275.   Internally, applying kills means to run the hook
  276. `gnus-Apply-kill-hook'.  It is called after the Subject buffer is
  277. prepared for a selected newsgroup.  The default hook is the function
  278. `gnus-apply-kill-file' which loads a global KILL file and a local KILL
  279. file in this order.  A different style of the kill processing can be
  280. implemented by customizing this hook.
  281.  
  282.   For example, if you think a global KILL file is unnecessary, you can
  283. use the following hook which applies only a local KILL file.  This
  284. change can save the time for checking the existence of a global KILL
  285. file.
  286.  
  287.      (setq gnus-Apply-kill-hook
  288.            '(lambda ()
  289.               ;; Apply a local KILL file.
  290.               (load (gnus-newsgroup-kill-file gnus-newsgroup-name) t nil t)))
  291.  
  292.   On the contrary, the following example enables only a global KILL
  293. file.
  294.  
  295.      (setq gnus-Apply-kill-hook
  296.            '(lambda ()
  297.               ;; Apply a global KILL file.
  298.               (load (gnus-newsgroup-kill-file nil) t nil t)))
  299.  
  300.   Here is an advanced example that drastically reduces the time for
  301. applying KILL files.  This hook does the kill processing directly
  302. without loading the KILL files.
  303.  
  304.      (setq gnus-Apply-kill-hook
  305.            '(lambda ()
  306.               ;; Apply to the newsgroup `control'
  307.               ;; if the NNTP server is flab.
  308.               (and (string-equal gnus-nntp-server "flab")
  309.                    (string-equal gnus-newsgroup-name "control")
  310.                    (progn
  311.                      (gnus-kill "Subject" "ihave flab\\|sendme")
  312.                      (gnus-kill "Subject" "cancel\\|newgroup\\|rmgroup" "d")
  313.                      (gnus-expunge "X")))))
  314.