🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #48119

slrn's locate_header_by_msgid and another deleting_thread without moving the cursor

#48119
From: blue... Dawn Owens-Nicholson
Date: Mon, 19 Apr 1999 00:00
64 lines
4268 bytes
Peppe wrote:
> Too long ago, can't remember. Might have been lack of understanding
> how it should be applied. After your explanations here, I will use
> this instead as it should lead to more sound solutions.

Here's a couple things to look out for when using locate_header_by_msgid
(and the related goto_article):

* Unnecessarily uncollapsing threads--lhbm will uncollapse the thread even
  if it doesn't need to to put the cursor on the target article.  Check this
  out by lhbm-jumping to an article at the head of a collapsed thread.

* lhbm will cause a download--if you give lhbm the message-ID of an article
  not in the header list but on the server, that article will be added to
  the bottom of the current header list.

  Unfortunately, in some cases, this leaves you with an ambiguous situation:
  was the article I wanted at the bottom of the header list or was it just
  added to the header list?  Sometimes, you can resolve the dispute by
  checking out the Newsgroups: header or read status, sometimes you can't.

Unfortunately there's no good way to work around all of lhbm's shortcomings
in all situations.  I'm hoping slrn will someday allow S-Lang access to a
header tree data structure complete with all known info (read headers,
status, body availability, etc.) so macros can walk this tree instead of
manipulating the cursor as one does from a keyboard.  This would mean you
could lhbm-hop around the real header list and quickly know what is in the
header list and what isn't.

Unfortunately, interpreting the original request that started this thread to
mean "don't disturb the display at all" means there is a large price to pay
for marking lengthy threads as read with this macro (note the loop--unroll
it and see how much code is /really/ executed).  It makes me curious what
the larger role is for this macro (is there one?); maybe there's another way
to solve the bigger problem and use faster code?

define delete_thread_no_move ()
{
   if (is_group_mode ())
     error (_function_name () + " doesn\'t work in group mode!");

   variable
     starting_article = extract_article_header ("Message-ID"),
     thread_was_collapsed = is_thread_collapsed ();

   uncollapse_thread ();
   loop (thread_size ())                         % call("delete_thread")-ish
     {
	set_header_flags (get_header_flags () | HEADER_READ);
	() = header_down (1);                    % just because I'm lazy and
     }                                           % it's sufficiently terse

   set_input_string (starting_article);          % go back to where we started
   call ("locate_header_by_msgid");              % lhbm is slightly buggy
   if (thread_was_collapsed) collapse_thread (); % restore thread collapse
   else uncollapse_thread ();                    % to work around lhbm bug
}

It's virtually the same as the one I posted before, just the first call()
was replaced and the macro will issue a better error in group mode.

Happy newsreading!
Technical Details
Message-ID: <slrn7hlsq3.ptv.bluemoon@ux6.cso.uiuc.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mail
References: <slrn7h3o65.jcd.hezu@tuuri.ling.helsinki.fi> <slrn7h472c.6d.c928400@urdybet.pbk.dk> <slrn7h4883.or7.davis@aluche.mit.edu> <slrn7h62fn.s3k.hezu@tuuri.ling.helsinki.fi> <slrn7h6vl6.103.c928400@urdybet.pbk.dk> <slrn7h8g72.8s3.hezu@tuuri.ling.helsinki.fi> <slrn7hac9a.upb.sas@hpprobe.div111.bell-labs.com> <slrn7hbepo.2nb.c928400@urdybet.pbk.dk> <slrn7hf4jr.a1k.bluemoon@ux6.cso.uiuc.edu> <slrn7hf9ek.ae.c928400@urdybet.pbk.dk> <slrn7hfd9j.51k.bluemoon@ux6.cso.uiuc.edu> <slrn7hglm7.1hh.c928400@urdybet.pbk.dk> <slrn7hl067.idp.bluemoon@ux6.cso.uiuc.edu> <slrn7hlnho.5h.c928400@urdybet.pbk.dk>

Show Full Headers
Complete Article Headers
Message-ID: <slrn7hlsq3.ptv.bluemoon@ux6.cso.uiuc.edu>
Subject: slrn's locate_header_by_msgid and another deleting_thread without moving the cursor
Date: Mon, 19 Apr 1999 00:00:00 +0000
From: blue...@ux6.cso.uiuc.edu (Dawn Owens-Nicholson)
References: <slrn7h3o65.jcd.hezu@tuuri.ling.helsinki.fi> <slrn7h472c.6d.c928400@urdybet.pbk.dk> <slrn7h4883.or7.davis@aluche.mit.edu> <slrn7h62fn.s3k.hezu@tuuri.ling.helsinki.fi> <slrn7h6vl6.103.c928400@urdybet.pbk.dk> <slrn7h8g72.8s3.hezu@tuuri.ling.helsinki.fi> <slrn7hac9a.upb.sas@hpprobe.div111.bell-labs.com> <slrn7hbepo.2nb.c928400@urdybet.pbk.dk> <slrn7hf4jr.a1k.bluemoon@ux6.cso.uiuc.edu> <slrn7hf9ek.ae.c928400@urdybet.pbk.dk> <slrn7hfd9j.51k.bluemoon@ux6.cso.uiuc.edu> <slrn7hglm7.1hh.c928400@urdybet.pbk.dk> <slrn7hl067.idp.bluemoon@ux6.cso.uiuc.edu> <slrn7hlnho.5h.c928400@urdybet.pbk.dk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mail
X-Deja-AN: 468226911
Organization: University of Illinois at Urbana-Champaign
User-Agent: slrn/0.9.5.4 (UNIX)
Newsgroups: news.software.readers,alt.lang.s-lang