🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
7 messages
7 total messages Started by hkan... Heikki Kantola Mon, 16 Sep 1996 00:00
Slrn 0.9.0.0 & slang questions
#25996
Author: hkan... Heikki Kantola
Date: Mon, 16 Sep 1996 00:00
16 lines
1336 bytes

I've playing with Slrn 0.9.0.0's slang support again, and found couple
problems. First I'm wondering how one can check some env variable's
value within slang (as I'd want to check the hostname and select few
things based on that). Secondly I'm wondering if there's any hope to
get somehow value of some header of the currently selected article
into some variable (I would want to create a function to grab From:-
field in order to get a author profile from Deja News).

-- 
Heikki "Hezu" Kantola, <Heikki...@IKI.FI>
Lähettämällä mainoksia tai muuta asiatonta sähköpostia yllä olevaan
osoitteeseen sitoudut maksamaan oikolukupalvelusta FIM500 alkavalta
tunnilta.
Re: Slrn 0.9.0.0 & slang questions
#26008
Author: da... John E. Davis
Date: Mon, 16 Sep 1996 00:00
29 lines
1656 bytes

On 16 Sep 1996 07:53:35 GMT, Heikki Kantola <hkan...@cc.Helsinki.FI>
wrote:
 : I've playing with Slrn 0.9.0.0's slang support again, and found couple
 : problems. First I'm wondering how one can check some env variable's
 : value within slang (as I'd want to check the hostname and select few

     Use the 'getenv' intrinsic function, e.g.,
     
          variable host = getenv ("HOSTNAME");
	  !if (strlen (host))
	     error ("HOSTNAME environment variable not set.");
	     
     
 : things based on that). Secondly I'm wondering if there's any hope to
 : get somehow value of some header of the currently selected article
 : into some variable (I would want to create a function to grab From:-
 : field in order to get a author profile from Deja News).

    An intrinsic to grab headers of the current article will be
    available in 0.9.1.

-- 
John E. Davis                   Center for Space Research/AXAF Science Center
617-258-8119                    MIT 37-662c, Cambridge, MA 02139
http://space.mit.edu/~davis

Re: Slrn 0.9.0.0 & slang questions
#26199
Author: Capt. Byron Alexander MRIN
Date: Sat, 21 Sep 1996 00:00
7 lines
703 bytes
Demarra Glen cumryn. Kalispera ticanis? Kalla?

!^NavFont02F00290006IGHHGq30AD


Re: Slrn 0.9.0.0 & slang questions
#26237
Author: Olly Betts
Date: Sun, 22 Sep 1996 00:00
101 lines
4041 bytes
In article <51oa9b$psr@aken.eed.ericsson.se>, Markolf Gudjons wrote:
>Is there a way to change between a "show unread" and "show all" mode?

Not really, since there aren't two different modes.  Slrn just has a
collection of articles in the header window.

However, here's a patch I wrote some time ago which adds a new function
(bound by default to Ctrl-A) to pull in from the server all headers not
currently in this collection.

There's a minor problem: the headers pulled in aren't scored (actually the
existing commands which pull in parents/children have the same flaw), and I
haven't had a chance to sort this out.  Perhaps someone else will fix it
for me.

You can "hide" read headers using 'x' (which expunges read headers) and with
this patch, you can "reveal" read headers using '^A'.

Olly

P.S. I've updated this patch to work on slrn 0.9.0.0.

--- art.c.orig	Tue Sep 10 14:32:00 1996
+++ art.c	Sun Sep 22 15:05:43 1996
@@ -193,6 +193,7 @@
 static Slrn_Article_Line_Type *unwrap_line (Slrn_Article_Line_Type *);
 static void quick_help (void);
 static void for_this_tree (Slrn_Header_Type *, void (*)(Slrn_Header_Type *));
+static Slrn_Header_Type *process_xover_line (char *buf);
 
 static void skip_to_next_group (void);
 
@@ -2537,6 +2538,45 @@
    while (1000 == slrn_header_down_n (1000, 0));
 }
 
+/* add in articles with server article ids start-end inclusive */
+static void fetch_range ( int start, int end )
+{
+   char buf[NNTP_BUFFER_SIZE];
+   if (start<=end)
+     {
+	Slrn_Server_Obj->sv_open_xover (start, end);
+	
+	while (NULL != Slrn_Server_Obj->sv_read_xover(buf, sizeof(buf) - 10))
+	  {
+	     Slrn_Header_Type *h;
+	     h = process_xover_line (buf);
+	     if (h == NULL) continue;
+	     get_header_real_name (h);
+	     insert_header (h);
+	  }
+	Slrn_Server_Obj->sv_close_xover ();
+     }
+}
+
+/* fetch all articles not currently fetched */
+static void fetch_all (void)
+{
+   Slrn_Header_Type *h;
+   int start,end;
+   
+   start = Slrn_Server_Min;
+   h = Slrn_First_Header;
+   while (h != NULL)
+     {
+	end = h->number-1;
+	if (start<=end)	fetch_range( start, end );
+	start = h->number+1;
+	h = h->real_next;
+     }
+   fetch_range( start, Slrn_Server_Max );
+   sort_by_sorting_mode ();
+}
+
 static int prev_unread (void)
 {
    Slrn_Header_Type *h;
@@ -5552,6 +5592,7 @@
    A_KEY("browse_url", browse_url),
    A_KEY("browse_url", browse_url),
    A_KEY("art_xpunge", art_xpunge),
+   A_KEY("fetch_all", fetch_all),
    A_KEY("wrap_article", wrap_article),
    A_KEY("goto_last_read", goto_last_read),
 #if SLRN_HAS_DECODE
@@ -5712,6 +5753,7 @@
    SLkm_define_key  ("u", (FVOID_STAR) undelete_header_cmd, Slrn_Article_Keymap);
    SLkm_define_key  ("U", (FVOID_STAR) browse_url, Slrn_Article_Keymap);
    SLkm_define_key  ("x", (FVOID_STAR) art_xpunge, Slrn_Article_Keymap);
+   SLkm_define_key  ("^A", (FVOID_STAR) fetch_all, Slrn_Article_Keymap);
    SLkm_define_key  ("t", (FVOID_STAR) toggle_headers, Slrn_Article_Keymap);
    SLkm_define_key  ("T", (FVOID_STAR) toggle_quotes, Slrn_Article_Keymap);
    SLkm_define_key  ("\033a", (FVOID_STAR) toggle_show_author, Slrn_Article_Keymap);

-- 
cool wet grass  cool wet grass  cool wet grass  cool wet grass  cool wet grass


Re: Slrn 0.9.0.0 & slang questions
#26284
Author: David Mears
Date: Mon, 23 Sep 1996 00:00
31 lines
1867 bytes
Olly Betts <olly@mantis.co.uk> wrote:

> However, here's a patch I wrote some time ago which adds a new function
> (bound by default to Ctrl-A) to pull in from the server all headers not
> currently in this collection.

> You can "hide" read headers using 'x' (which expunges read headers) and
> with this patch, you can "reveal" read headers using '^A'.

Once the previously read headers have been pulled in from the server the
first time, do they have to be pulled in later, or will they be remembered?
That is, with your patch installed, if one does ^A followed by x followed
by ^A, does the second ^A command have to reaccess the server again for
all those headers?  It would be best if it didn't have to because they
were already cached from the first time.

I've wanted the ability to do this for awhile, to be able to match the
equivalent functionality from tin, but it wouldn't be very nice if it
caused a major server hit more than just the once.

Another question:  does your ^A command prompt about how many to read
if more than the limit in the .slrnrc file?

David B. Mears
Hewlett-Packard
Cupertino CA
mears@cup.hp.com


Re: Slrn 0.9.0.0 & slang questions
#26311
Author: Olly Betts
Date: Tue, 24 Sep 1996 00:00
54 lines
3144 bytes
In article <slrn54df7f.8eq.mears@hpindft.cup.hp.com>, David Mears wrote:
>Olly Betts <olly@mantis.co.uk> wrote:
>
>> However, here's a patch I wrote some time ago which adds a new function
>> (bound by default to Ctrl-A) to pull in from the server all headers not
>> currently in this collection.
>
>> You can "hide" read headers using 'x' (which expunges read headers) and
>> with this patch, you can "reveal" read headers using '^A'.
>
>Once the previously read headers have been pulled in from the server the
>first time, do they have to be pulled in later, or will they be remembered?

They have to be pulled in again.  It's not ideal, but it's more efficient
than having to exit the group and re-enter with "Esc 1 Space" which will
re-fetch all the unread headers as well as the read ones.

Internally, slrn can "hide" headers, which is used for collapsing the thread
tree.  However, trying to reuse the flag looked like a recipe for problems
(e.g. searches should search collapsed trees, but probably not hidden read
headers).

It should be possible to add expunged headers to a separate list instead of
free-ing them, and to merge this with the normal header list, and then run
through to find any gaps as at present.  It's not totally trivial though.

>I've wanted the ability to do this for awhile, to be able to match the
>equivalent functionality from tin, but it wouldn't be very nice if it
>caused a major server hit more than just the once.

I don't think it's that major a server hit -- the patch just sends requests
for the overview information for the any gaps in the server numbers in its
list of which headers it has.

On a reasonably configured server, the overview information is stored in a
separate file, so it's probably about the same hit as reading an article of
a few hundred lines.  Admittedly I've only tried it with the local spool
backend on a server with a 4 day expire.

>Another question:  does your ^A command prompt about how many to read
>if more than the limit in the .slrnrc file?

Nope.  That could probably be done by reading backwards through the headers.

Anyway, thanks for the comments.  I'll have a look at making the two
enhancements when I have a bit of spare time.

Olly
-- 
cool wet grass  cool wet grass  cool wet grass  cool wet grass  cool wet grass


Re: Slrn 0.9.0.0 & slang questions
#26337
Author: David Mears
Date: Wed, 25 Sep 1996 00:00
63 lines
3640 bytes
Olly Betts <olly@mantis.co.uk> wrote:

> David Mears wrote:

> >Olly Betts <olly@mantis.co.uk> wrote:

> >> However, here's a patch I wrote some time ago which adds a new function
> >> (bound by default to Ctrl-A) to pull in from the server all headers not
> >> currently in this collection.

> >> You can "hide" read headers using 'x' (which expunges read headers) and
> >> with this patch, you can "reveal" read headers using '^A'.

> >Once the previously read headers have been pulled in from the server the
> >first time, do they have to be pulled in later, or will they be remembered?

> They have to be pulled in again.  It's not ideal, but it's more efficient
> than having to exit the group and re-enter with "Esc 1 Space" which will
> re-fetch all the unread headers as well as the read ones.

> Internally, slrn can "hide" headers, which is used for collapsing the thread
> tree.  However, trying to reuse the flag looked like a recipe for problems
> (e.g. searches should search collapsed trees, but probably not hidden read
> headers).

Interesting.  This brings up another issue.  There's a functionality in
tin that I would dearly love to have in slrn.  I use it quite often in
tin, and with it available in slrn, I could probably switch fully to slrn
and quit using tin altogether.

Tin has a command, X, which can be used to `hide' unselected articles.
Used in conjunction with tin's = command to select articles based on a
pattern, the resulting functionality is very useful.  Articles can be
selected based on any pattern matching criteria, then all other articles
hidden so only selected articles are visible and processed.  One can
then read through only the selected articles (which can be done, sort
of, in slrn by scoring those articles above others), or one can quickly
scan the selected headers and kill (i.e. mark as read) most or all of
them as desired.  The remaining articles can then be unhidden for more
processing.

The X command acts like a toggle.  The first time, it will hide unselected
articles; typed again it will expose articles previously hidden with X.  If
articles remain hidden when the group is exited, those hidden articles are
marked as read.

With slrn's new macro functioanlity, I believe I could write a function
to read a pattern, search for articles matching the pattern, and select
them.  This would let me match tin's = command.  With a simple function
to hide/unhide a given article, and a way to process either the hidden
list or the unhidden list of articles, then a macro could be written to
find unselected headers, hide them, and later unhide hidden articles.
A quit macro could be written to either mark as read, or leave unread,
any articles hidden when leaving the group.

David B. Mears
Hewlett-Packard
Cupertino CA
mears@cup.hp.com


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