🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #256053

Re: slrn keyboard commands

#256053
From: J.B. Nicholson-Owens
Date: Sun, 03 Nov 2013 22:22
31 lines
2479 bytes
Phil Boutros <philb@philb.ca> wrote:
> setkey article "call(\"toggle_collapse_threads\");call(\"delete\")" "X"

If the goal is to mark an entire thread as read, the above won't mark
the current thread read when the current thread is collapsed.

I think you're looking for something closer to the following:

#v+
define my_mark_thread_as_read () 
{
   % Note the article we started on and the collapse status
   % of the current thread so we can do this job without
   % disturbing the display.
   variable
     starting_article = extract_article_header ("Message-ID"),
     thread_was_collapsed = is_thread_collapsed ();
   
   !if (thread_was_collapsed) collapse_thread ();
   call ("delete");
   variable ending_article = extract_article_header ("Message-ID");
   
   % Leave the thread marked read as it was collapsed/uncollapsed.
   () = locate_header_by_msgid (starting_article, 0);
   !if (thread_was_collapsed) uncollapse_thread ();
   
   % Put the cursor where the interactive function "delete" left it.
   () = locate_header_by_msgid (ending_article, 0);
}
definekey ("Global->my_mark_thread_as_read", "X", "article");
#v-
Technical Details
Message-ID: <slrnl7dj62.mup.jbn@forestfield.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!news.albasani.net!.POSTED!not-for-mail
References: <slrnl6s4a0.26a.mr@irc.sandman.net> <slrnl7bopa.qm3.philb@ah61.is-a-geek.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrnl7dj62.mup.jbn@forestfield.org>
Subject: Re: slrn keyboard commands
Date: Sun, 03 Nov 2013 22:22:57 +0000
From: "J.B. Nicholson-Owens" <jbn@forestfield.org>
References: <slrnl6s4a0.26a.mr@irc.sandman.net> <slrnl7bopa.qm3.philb@ah61.is-a-geek.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.20140922.mbox.gz!border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!news.albasani.net!.POSTED!not-for-mail
Newsgroups: news.software.readers
Organization: albasani.net
Lines: 31
X-Trace: news.albasani.net
 ETykVxxKR+zFaTtgcvpsSllNrQ+K0TZLao9cKH1yH9SItrC58P25PC9BIhO69B5U5lwkSEdLSYKVb+2NC+Hc0w==
NNTP-Posting-Date: Sun, 3 Nov 2013 22:22:57 +0000 (UTC)
Injection-Info: news.albasani.net;
 logging-data="3NHQMzr7QWhhqRRt0+K0XvugU2ePJJCFYR9FObR1GSJimLcMlx31jzStP/tW5+XXn1DytDn3MlU/A8XxS18hcbYhSX6gHnKDB18dmvXNqSlri1Ed7HHE558Vgjukf6x9";
 mail-complaints-to="abuse@albasani.net"
User-Agent: slrn/pre1.0.0-18 (Linux)
Cancel-Lock: sha1:aX0gLVVJ3kDdxMH0uhJBFqpXiCU=
X-Original-Bytes: 2261