Article View: news.software.readers
Article #26237Re: Slrn 0.9.0.0 & slang questions
From: Olly Betts
Date: Sun, 22 Sep 1996 00:00
Date: Sun, 22 Sep 1996 00:00
101 lines
4041 bytes
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
Technical Details
Message-ID:
<slrn54aifg.glb.olly@mantis.co.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<51j11v$r4s@oravannahka.Helsinki.FI> <slrn53qfd2.cu.davis@aluche.mit.edu> <51oa9b$psr@aken.eed.ericsson.se>Show Full Headers
Complete Article Headers
Message-ID: <slrn54aifg.glb.olly@mantis.co.uk> Subject: Re: Slrn 0.9.0.0 & slang questions Date: Sun, 22 Sep 1996 00:00:00 +0000 From: olly@mantis.co.uk (Olly Betts) References: <51j11v$r4s@oravannahka.Helsinki.FI> <slrn53qfd2.cu.davis@aluche.mit.edu> <51oa9b$psr@aken.eed.ericsson.se> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 184579946 Content-type: text/plain; charset=iso-8859-1 Organization: Mantis Consultants Ltd, Cambridge. UK. Mime-version: 1.0 Newsgroups: news.software.readers