🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #31857

Re: slrn 0.9.3 officially released

#31857
From: Olly Betts
Date: Sat, 01 Mar 1997 00:00
96 lines
4125 bytes
In article <slrn5h6f5k.4pm.mears@xsvr2.cup.hp.com>, David Mears wrote:
>Unfortunately, 0.9.3.1 still exhibits a bug that has been around for
>quite some time.
>
>The problem has to do with FormFeed (spoiler protection) and line numbers.
>If the article has a FF in it, then text before the FF is displayed and
>text after the FF is replaced by * (or whatever is defined), and the line
>number computed is line 1, as verified by the display at the bottom of
>the screen.  So far, so good.  Now, if the user enters a scroll_dn, slrn
>will display the next group of text after the first FF and it will move
>that first line to the top of the display.  However, and here's the bug,
>the computed line number is *still* line 1, as verified by the line number
>display at the bottom of the screen.

Here's a patch (for 0.9.3.1) which fixes that bug and also makes moving the
spoiler to the top of the page optional (since I for one detest it and it's
been irritating me ever since it was "fixed").  The new .slrnrc option is:

 % set this to 1 to start a new page when a spoiler is revealed
 % set to 0 to keep the display still, and just reveal the spoiler
 set spoiler_start_new_page 1

The default is not to start a new page (this was the original behaviour in
older versions of slrn).

diff -u slrn.orig/src/art.c slrn/src/art.c
--- slrn.orig/src/art.c	Tue Feb 25 11:12:32 1997
+++ slrn/src/art.c	Sat Mar  1 19:59:44 1997
@@ -102,6 +102,7 @@
 int Slrn_Sig_Is_End_Of_Article = 0;
 #if SLRN_HAS_SPOILERS
 int Slrn_Spoiler_Char = 42;
+int Slrn_New_Page_For_Spoiler = 0; /* useful for ASCII art animations */
 #endif
 int Slrn_New_Subject_Breaks_Threads = 0;
 
@@ -5274,7 +5290,8 @@
 	  {
 	     l = l->next;
 	  }
-	l1 = l;
+	if (l1 == NULL) /* want to move to the top of the first spoiler */
+	  l1 = l;
 	/* now un-spoiler until we hit an un-spoiler-ed line */
 	while ((l != NULL) && (l->flags & SPOILER_LINE))
 	  {
@@ -5284,7 +5301,10 @@
      } /* Prefix arg means un-spoiler the whole article */
    while ((Slrn_Prefix_Arg_Ptr != NULL) && (l != NULL));
    Slrn_Prefix_Arg_Ptr = NULL;
-   if (l1 != NULL) Article_Current_Line = l1;
+   if (Slrn_New_Page_For_Spoiler && l1 != NULL) {
+      Article_Current_Line = l1;
+      find_article_line_num ();
+   }
    Slrn_Full_Screen_Update = 1;
 }
 
diff -u slrn.orig/src/art.h slrn/src/art.h
--- slrn.orig/src/art.h	Tue Feb 25 11:12:32 1997
+++ slrn/src/art.h	Sat Mar  1 19:49:34 1997
@@ -32,7 +32,8 @@
 extern char *Slrn_NonX_Browser;
 #if SLRN_HAS_SPOILERS
 extern int Slrn_Spoiler_Char;
+extern int Slrn_New_Page_For_Spoiler;
 #endif
 #if SLRN_HAS_TILDE_FEATURE
 extern int Slrn_Use_Tildes;
 #endif
diff -u slrn.orig/src/startup.c slrn/src/startup.c
--- slrn.orig/src/startup.c	Tue Feb 25 11:12:33 1997
+++ slrn/src/startup.c	Sat Mar  1 19:49:01 1997
@@ -339,8 +339,10 @@
      {"use_header_numbers", &Slrn_Use_Header_Numbers},
 #if SLRN_HAS_SPOILERS
      {"spoiler_char", &Slrn_Spoiler_Char},
+     {"spoiler_start_new_page", &Slrn_New_Page_For_Spoiler},
 #else
      {"spoiler_char", NULL},
+     {"spoiler_start_new_page", NULL},
 #endif
 #if SLRN_HAS_MIME
      {"use_mime", &Slrn_Use_Mime},

A quick search through art.c suggests to me there should be a couple more
'find_article_line_num();' statements (for example after unwrapping lines),
but I don't have time to check them out right now.

Cheers,
Olly
-- 
Usenet is not for answering questions but for questioning answers.

Technical Details
Message-ID: <slrn5hh4g3.i55.olly@noxious.muscat.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-mail
References: <slrn5h1rnm.2ss.davis@mygir.davis.net> <slrn5h6f5k.4pm.mears@xsvr2.cup.hp.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrn5hh4g3.i55.olly@noxious.muscat.co.uk>
Subject: Re: slrn 0.9.3 officially released
Date: Sat, 01 Mar 1997 00:00:00 +0000
From: olly@muscat.co.uk (Olly Betts)
References: <slrn5h1rnm.2ss.davis@mygir.davis.net> <slrn5h6f5k.4pm.mears@xsvr2.cup.hp.com>
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: 222708297
Organization: PSINet UK
Newsgroups: news.software.readers