🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #55233

Re: [slrn] Distinguishing between header versus article mode

#55233
From: Dawn Owens-Nicholson
Date: Tue, 14 Dec 1999 00:00
105 lines
7190 bytes
I wrote:
>  !if (is_article_visible ()) return ();
>  variable current_article = extract_article_header ("Message-ID");
>  if (locate_header_by_msgid (scroll_down_article, 0))
>    {
>       call ("article_linedn");
>       () = locate_header_by_msgid (current_article, 0);
>    }

Chris Green wrote:
> But this still misses the point, call ("article_linedn") *doesn't*
> scroll one line down in the article, even when wrapped up in
> is_article_visible() tests.

It's not wrapped in is_article_visible() tests, it's wrapped in a
locate_header_by_msgid() which puts the cursor at a different article.
There's a big difference.

> I have tried the above snippet of code, bound to the 'n' key.

Please post the code you wrote which incorporates the above snippet.

> If you hit 'n' when in a collapsed thread that is more than one page long
> then you *still* get dropped back to the first message in the thread.

Of course--clearly the snippet isn't meant to handle collapsed threads in
the way you wanted.  There is no code in the snippet which deals explicitly
with collapsing or uncollapsing any thread.  Like I said before, this is to
*get you started*. It's not a complete solution all written and handed to
you ready-to-go.  It's expected that you will put work into figuring out
what the snippet does (and how) and use that knowledge to make your own
macro or C code.

> The whole problem is that the logic of article_linedn in slrn's C code
> is such that it *doesn't* just attempt to scroll down one line in an
> article.  It has to *decide for itself* whether slrn is showing an
> article or the article list or what.  Then if it thinks an article is
> being displayed it scrolls down one line.

Wrong.  The problem for you is you're not setting slrn's cursor to the right
place so article_linedn does what you want it to do (this means
programmatically determining where the cursor has to be).  As for the logic
of article_linedn, you've got that wrong too.  In article mode only, IF THE
VISIBLE ARTICLE IS THE ARTICLE BEING POINTED TO BY THE CURSOR,
article_linedn does precisely what you want--the visible article is scrolled
one line down. Otherwise, there is either NO ARTICLE VISIBLE or THE CURSOR
IS NOT POINTING TO THE VISIBLE ARTICLE.  In either of the latter two cases,
article_linedn causes slrn to possibly download the article and show it to
you (no scrolling happens if the article was downloaded otherwise the cached
article is unhidden and scrolled down one line).  Readers who are paying
attention will notice how the three cases in all caps map precisely to the
output of is_article_visible().

> Unfortunately the tests in slrn's C code don't work exactly the same as
> is_article_visible() does and, if the thread is collapsed, the C code
> doesn't make the right decision.  This is why I think it's actually a bug,
> it's just rather an abstruse bug.  I can't imagine any reason why one would
> want the article_linedn command to do what it does do in this particular
> case.

You're confusing yourself by thinking about collapsed threads--in slrn,
uncollapsing threads and collapsing threads have an indirect relationship
with scrolling an article one line down.  When threads are collapsed the
interior articles are *completely inaccessible* to the cursor.  This is not
a bug, it was intentionally designed this way.  To make them accessible one
must first uncollapse the thread to get to them either explicitly (with
uncollapse_threads() or uncollapse_all_threads()) or implicitly (by going to
an article inside the collapsed thread--a variety of intrinsic and S-Lang
functions will do this including scroll_dn and locate_header_by_msgid()).

We want this to be the way it is because reading news interactively gets the
highest priority.  The way things work now is how one expects them to work
when reading news without macros.  Macro coders are expected to bend over
backwards a little bit to get what they want.  This is not a hassle or a
problem for you because all the functions you need to get the job done are
in slrn's S-Lang API.

I'll explain another way, when people read news they only care about where
the cursor is when they want to tell slrn "I want to skip to *this* article
now.".  Otherwise, they let the cursor go wherever it has to go to let them
read new news.  Therefore, cursor-centric commands work best for interactive
use.  Macro writers know this from way back before you ever got involved
with slrn.  Macro writers also know that keeping track of where the cursor
should go and tracking the collapsed state of threads is part of the job of
writing well-behaved macros.

> OK, so if I want to change the C code in slrn I can probably get what
> I want, but I don't think it's seriously possible at all using macros
> because the underlying article_linedn code can't be 'forced' to just
> scroll down one line in an article.

So, in other words, you don't *know* if what you want can be done (just like
you didn't know what shortcomings exist using a macro with respect to
redrawing the screen) but it's easier to publicly postulate and complain
then it is to experiment, learn and write code.  You spend more time talking
about your problems than doing something about them.  You don't post the
S-Lang code you say you ran to incorporate the snippet I provided, you
haven't make any patches available to alter slrn to do what you want it to
do and you complain a lot about how slrn is broken in this respect.  I think
you want someone else to fix your problem for you; prove to you that what
you want can be done by posting a ready-made solution but you won't come out
and ask for it because that would make it obvious you aren't willing to put
time into your own problem.

Technical Details
Message-ID: <slrn85d62l.pc9.bluemoon@ux6.cso.uiuc.edu>
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: <slrn847vtl.e03.cgreen@shell.x-1.net> <slrn84atjf.nq7.bluemoon@ux6.cso.uiuc.edu> <slrn84d5t3.lns.cgreen@shell.x-1.net> <slrn84dpsa.7fh.bluemoon@ux6.cso.uiuc.edu> <slrn84fhm9.osf.cgreen@shell.x-1.net> <slrn84gau1.5q3.bluemoon@ux6.cso.uiuc.edu> <slrn84n652.8qh.cgreen@shell.x-1.net> <slrn84o3vd.qo0.bluemoon@ux6.cso.uiuc.edu> <slrn84obh8.dam.cgreen@shell.x-1.net> <slrn84qlat.ojl.bluemoon@ux6.cso.uiuc.edu> <slrn84satm.j2i.cgreen@shell.x-1.net> <slrn850690.cv.sgibier@hermes.olympus.fr> <slrn851bl9.t3j.bluemoon@ux6.cso.uiuc.edu> <slrn852b6r.rt1.cgreen@shell.x-1.net> <slrn852kd6.iia.bluemoon@ux6.cso.uiuc.edu> <slrn859i52.l03.cgreen@shell.x-1.net> <slrn85b228.cs5.bluemoon@ux6.cso.uiuc.edu> <slrn85cf0q.r49.cgreen@shell.x-1.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrn85d62l.pc9.bluemoon@ux6.cso.uiuc.edu>
Subject: Re: [slrn] Distinguishing between header versus article mode
Date: Tue, 14 Dec 1999 00:00:00 +0000
From: bluemoon@ux6.cso.uiuc.edu (Dawn Owens-Nicholson)
References: <slrn847vtl.e03.cgreen@shell.x-1.net> <slrn84atjf.nq7.bluemoon@ux6.cso.uiuc.edu> <slrn84d5t3.lns.cgreen@shell.x-1.net> <slrn84dpsa.7fh.bluemoon@ux6.cso.uiuc.edu> <slrn84fhm9.osf.cgreen@shell.x-1.net> <slrn84gau1.5q3.bluemoon@ux6.cso.uiuc.edu> <slrn84n652.8qh.cgreen@shell.x-1.net> <slrn84o3vd.qo0.bluemoon@ux6.cso.uiuc.edu> <slrn84obh8.dam.cgreen@shell.x-1.net> <slrn84qlat.ojl.bluemoon@ux6.cso.uiuc.edu> <slrn84satm.j2i.cgreen@shell.x-1.net> <slrn850690.cv.sgibier@hermes.olympus.fr> <slrn851bl9.t3j.bluemoon@ux6.cso.uiuc.edu> <slrn852b6r.rt1.cgreen@shell.x-1.net> <slrn852kd6.iia.bluemoon@ux6.cso.uiuc.edu> <slrn859i52.l03.cgreen@shell.x-1.net> <slrn85b228.cs5.bluemoon@ux6.cso.uiuc.edu> <slrn85cf0q.r49.cgreen@shell.x-1.net>
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: 560645414
Organization: University of Illinois at Urbana-Champaign
User-Agent: slrn/0.9.5.7 (UNIX)
Newsgroups: news.software.readers