Thread View: news.software.readers
5 messages
5 total messages
Started by Parand Tony Darugar
Tue, 30 Jun 1998 00:00
[SLRN] mark following article as read?
Author: Parand Tony Darugar
Date: Tue, 30 Jun 1998 00:00
Date: Tue, 30 Jun 1998 00:00
26 lines
1595 bytes
1595 bytes
Hello, Is there a good way to mark articles the are below the cursor as read? Basically the functionality of 'C', but for articles from the cursor to the end as opposed to from the top to here. This comes in handy because with the score file in place most articles of interest appear at the top, and after some point the remainder is mostly junk. Better yet, is it possible to mark a range of articles, and perform operations on them? That is, instead of individually tagging an article, can I place a marker at one point, scroll a couple of pages down, set a second marker, and perform some operation on the region between the two markers (eg. mark them as read)? While I'm at it, is there a way to tell slrn to mark all articles that have a particular word/phrase in them as read? I'm using slrn 0.9.5.2 with slang 1.2.2 on linux. Best, Tony Darugar
Re: [SLRN] mark following article as read?
Author: Dawn Owens-Nicholson
Date: Tue, 30 Jun 1998 00:00
Date: Tue, 30 Jun 1998 00:00
23 lines
1366 bytes
1366 bytes
There are other errors, but here's one that stuck out the instant I
posted it (someday I'll test stuff first):
I wrote:
> if (string_match (regex, article_line, 0))
> {
> set_header_flags (get_header_flags () | HEADER_READ);
> articles_marked_read++;
> }
I should have written:
if (string_match (regex, article_line, 0))
{
set_header_flags (get_header_flags () | HEADER_READ);
articles_marked_read++;
break;
}
Without the break, the function will unnecessarily continue to scan
the same article for more matches.
Re: [SLRN] mark following article as read?
Author: Bill McCarthy
Date: Tue, 30 Jun 1998 00:00
Date: Tue, 30 Jun 1998 00:00
19 lines
1025 bytes
1025 bytes
On Tue, 30 Jun 1998 17:42:33 GMT, Parand Tony Darugar wrote: > > Is there a good way to mark articles the are below the cursor >as read? Basically the functionality of 'C', but for articles >from the cursor to the end as opposed to from the top to here. >This comes in handy because with the score file in place most >articles of interest appear at the top, and after some point >the remainder is mostly junk. c esc-U u -- Bill McCarthy Wendell, NC USA
Re: [SLRN] mark following article as read?
Author: Dawn Owens-Nicholson
Date: Tue, 30 Jun 1998 00:00
Date: Tue, 30 Jun 1998 00:00
143 lines
5022 bytes
5022 bytes
Parand Tony Darugar <tdarugar@binevolve.com> wrote:
> Is there a good way to mark articles the are below the cursor
> as read?
You could do the things you ask for in a S-Lang macro. Read
slrn/doc/README.macros and the S-Lang intro in slang/doc/ for info on
slrn's S-Lang API and an intro to S-Lang, respectively. The following
is not completely accurate, but it's quick:
define catchup_below ()
{
call ("catchup_all"); % bound to "c" by default
call ("uncatchup"); % bound to "\eU" by default
call ("undelete"); % bound to "u" by default
}
Put this function in a file, interpret it from your slrn.rc (with the
"interpret" command) or from another S-Lang file (with evalfile()) and
bind a key to it to make all three actions happen with one keystroke.
> This comes in handy because with the score file in place most
> articles of interest appear at the top, and after some point
> the remainder is mostly junk.
You could score the junk with a kill score (-9,999 by default) and
never see the junk to begin with.
> Better yet, is it possible to mark a range of articles, and perform
> operations on them?
You could make macros that use slrn's numeric tagging (and you get
ordered tagging for free) by doing something like this:
define ordered_numeric_tags_processing ()
{
variable
n = 1,
starting_place = extract_article_header ("Message-ID");
do
{
call ("header_bob");
if (get_header_tag_number () == n)
{
% ...do something here...
n++;
}
}
while (header_down (1));
set_input_string (starting_place);
call ("locate_header_by_msgid");
}
> That is, instead of individually tagging an article, can I place a
> marker at one point, scroll a couple of pages down, set a second
> marker, and perform some operation on the region between the two
> markers (eg. mark them as read)?
Sure, it might look like this:
define between_numeric_tags_processing ()
{
variable starting_place = extract_article_header ("Message-ID");
call ("header_bob");
do
{
if (get_header_tag_number ())
{
() = header_down (1);
while (get_header_tag_number () == 0)
call ("delete");
break;
}
}
while (header_down (1));
set_input_string (starting_place);
call ("locate_header_by_msgid");
}
This code will enter an endless loop if there's only one header tag
number in the header list, but I think it's sufficient to get the idea
across that you can do a number of things with slrn's macros.
> While I'm at it, is there a way to tell slrn to mark all
> articles that have a particular word/phrase in them as read?
Yes, but any processing of article contents is a high-bandwidth
operation. I wouldn't do this if you aren't using a fast connection
to your news server. If article body scoring becomes available, I
recommend you use that instead of a macro (the compiled C code will be
faster). Your macro could look like this:
define mark_read_on_content (regex)
{
variable
articles_marked_read = 0,
starting_place = extract_article_header ("Message-ID");
call ("header_bob");
do
{
variable
article_body = article_as_string (),
article_line = "",
n = 0;
while (article_line = extract_element (article_body, n, '\n'),
article_line != NULL)
{
if (string_match (regex, article_line, 0))
{
set_header_flags (get_header_flags () | HEADER_READ);
articles_marked_read++;
}
n++;
}
}
while (header_down (1));
set_input_string (starting_place);
call ("locate_header_by_msgid");
}
None of the code examples are tested and none will handle collapsed
threads properly, but I think they convey enough so that you get the
idea of what's going on. They all try to store where you called the
function, do some operation and put the arrow (or bar) where it began.
The last example is a function that takes a regular expression for an
argument. I'll leave it to you to look up what regex constructs
S-Lang supports.
I hope this helps you!
Re: [SLRN] mark following article as read?
Author: Rich Lafferty
Date: Mon, 06 Jul 1998 00:00
Date: Mon, 06 Jul 1998 00:00
24 lines
1576 bytes
1576 bytes
Parand Tony Darugar <tdarugar@binevolve.com> wrote: >Hello, > > Is there a good way to mark articles the are below the cursor >as read? Basically the functionality of 'C', but for articles >from the cursor to the end as opposed to from the top to here. >This comes in handy because with the score file in place most >articles of interest appear at the top, and after some point >the remainder is mostly junk. I personally read the articles at the top, and then after reaching the top of the bottom cruft, do a 'c' to catchup. Same number of keypresses, same functionality, just different order. -Rich -- Rich Lafferty --------------------------------------------------------- IITS/Computing Services | Concordia University | Nothing sucks like a Vax! (tm) rich@vax2.concordia.ca -----------------------------------------[McQ]--
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