home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / ONLINE / SLRN_CP / MACROS / NN.SL next >
Text File  |  1996-12-09  |  2KB  |  109 lines

  1. %!% I have no idea what this file has to do with the nn newsreader.  
  2. %!% It simply defines a set of macros for selecting articles and then reading
  3. %!% the articles associated with the selected headers.   Several people have
  4. %!% remarked that this is how one reads with nn.
  5. %!% 
  6. %!% Based on that idea, here is how the macros in this file work:
  7. %!% 
  8. %!%    1.  Tag headers by one of the following methods:
  9. %!%
  10. %!%        a. Move to header and press the ' key.
  11. %!%        b. Select a header by pressing the header number associated
  12. %!%           with it.
  13. %!%        c. Select headers via author/subject regular expressions
  14. %!% 
  15. %!%    2.  After selection, read selected articles via:
  16. %!%           [          Previous selected
  17. %!%           ]          Next Selected
  18.  
  19. variable NN_Tag_Selection_Mode = 0;
  20.  
  21.  
  22. define nn_tag_header ()
  23. {
  24.    NN_Tag_Selection_Mode = 1;
  25.    star_tag_header ();
  26. }
  27.  
  28.  
  29. define header_number_hook () 
  30. {
  31.    nn_tag_header ();
  32. }
  33.  
  34.  
  35. define nn_read_prev_tagged () 
  36. {
  37.    !if (prev_tagged_header ())
  38.      error ("No more tagged headers.");
  39.    
  40.    star_untag_header ();
  41.    art_select_article ();
  42. }
  43.  
  44.  
  45.  
  46. define nn_read_next_tagged () 
  47. {
  48.    mark_spot ();
  49.    ERROR_BLOCK
  50.      {
  51.     goto_spot ();
  52.      }
  53.    
  54.    if (NN_Tag_Selection_Mode)
  55.      {
  56.     NN_Tag_Selection_Mode = 0;
  57.     header_bob ();
  58.      }
  59.    
  60.    !if (get_header_flags () & HEADER_TAGGED)
  61.      {
  62.     !if (next_tagged_header ())
  63.       error ("No more tagged headers.");
  64.      }
  65.    
  66.    star_untag_header ();
  67.    art_select_article ();
  68. }
  69.  
  70.  
  71.  
  72. define nn_tag_header_cmd ()
  73. {
  74.    nn_tag_header ();
  75.    () = header_down (1);
  76. }
  77.  
  78. define nn_tag_via_subject_regexp ()
  79. {
  80.    variable str;
  81.    variable count = 0;
  82.    
  83.    str = read_mini ("Tag subjects pattern", "", "");
  84.    !if (strlen (str))
  85.      return;
  86.  
  87.    mark_spot ();
  88.    
  89.    uncollapse_threads ();
  90.    while (re_fsearch_subject (str))
  91.      {
  92.     nn_tag_header ();
  93.     count++;
  94.     !if (header_down (1))
  95.       break;
  96.      }
  97.    collapse_threads ();
  98.  
  99.    goto_spot ();
  100.    message (Sprintf ("%d headers marked.", count, 1));
  101. }
  102.  
  103.  
  104. definekey ("nn_tag_via_subject_regexp", "%", "article");
  105. definekey ("nn_tag_header_cmd", "'", "article");
  106. definekey ("nn_read_next_tagged", "]", "article");
  107. definekey ("nn_read_prev_tagged", "[", "article");
  108.  
  109.