🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
16 messages
16 total messages Started by Erik Hahn Thu, 25 Sep 2008 20:51
[slrn] Display all threads that contain unread messages
#226333
Author: Erik Hahn
Date: Thu, 25 Sep 2008 20:51
11 lines
1549 bytes
The page at http://tinyurl.com/477j9r (Google Cache, it isn't available
at the original place anymore) claims that you could use a macro to
display all threads fully that contain at least one unread message. Does
such a macro already exist or could someone create it (I don't know
s-lang)?

	-Erik

-- 
hackerkey://v4sw5hw2ln3pr5ck0ma2u7LwXm4l7Gi2e2t4b7Ken4/7a16s0r1p-5.62/-6.56g5OR
Re: [slrn] Display all threads that contain unread messages
#226338
Author: Peter J Ross
Date: Thu, 25 Sep 2008 22:41
34 lines
2670 bytes
In news.software.readers on Thu, 25 Sep 2008 22:51:18 +0200, Erik Hahn
<erik_hahn@replyto.invalid> wrote:

> The page at http://tinyurl.com/477j9r (Google Cache, it isn't available
> at the original place anymore)

That's because I deleted the unofficial documentation updates from my
site a few weeks after they were officially included with slrn. The
relevant page is now here:

<http://slrn.org/docs/slrn-FAQ-3.html>

(I may be able to prevent such problems with broken links in future
with Apache's mod_rewrite.)

> claims that you could use a macro to
> display all threads fully that contain at least one unread message. Does
> such a macro already exist or could someone create it (I don't know
> s-lang)?

I don't know of such a macro, and I don't know how to write one, but
somebody might. The FAQ provides a big hint that somebody ought to
implement this feature, and JED has indicated that an S-Lang
implementation of such extra features would be preferable to a C
implementation, but it seems not to have been done yet.

Thanks for raising this issue, Erik. I'm sorry I don't have a solution
to offer you.

-- 
PJR :-)
slrn newsreader (v0.9.9): http://slrn.sourceforge.net/
extra slrn documentation: http://slrn-doc.sourceforge.net/
newsgroup name validator: http://pjr.lasnobberia.net/usenet/validator
Re: [slrn] Display all threads that contain unread messages
#226339
Author: andrew
Date: Thu, 25 Sep 2008 22:41
16 lines
1747 bytes
On 2008-09-25, Erik Hahn <erik_hahn@replyto.invalid> wrote:

> The page at http://tinyurl.com/477j9r (Google Cache, it isn't
> available at the original place anymore) claims that you could use a
> macro to display all threads fully that contain at least one unread
> message. Does such a macro already exist or could someone create it (I
> don't know s-lang)?

Not really an answer to your question but that page exists here:

http://slrn.sourceforge.net/docs/slrn-FAQ-3.html

  Andrew

-- 
Do you think that's air you're breathing now?
Re: [slrn] Display all threads that contain unread messages
#226380
Author: Bob Cortopassi
Date: Sat, 27 Sep 2008 05:51
30 lines
2240 bytes
On 2008-09-25, Erik Hahn <erik_hahn@replyto.invalid> wrote:
> The page at http://tinyurl.com/477j9r (Google Cache, it isn't available
> at the original place anymore) claims that you could use a macro to
> display all threads fully that contain at least one unread message. Does
> such a macro already exist or could someone create it (I don't know
> s-lang)?

This should work, and yet it doesn't.  Maybe someone more familiar
with s-lang and slrn's interaction can take it from here.  It does the
right thing on the first article, but that's it.

define get_all_parents ()
{
   variable i = group_unread() - 1;

   do 
   {
      set_prefix_argument (1); 
      call ("get_parent_header");
      header_next_unread();
      i--;
   } 
   while (i);
}

definekey ("get_all_parents", "p", "article");

-- 
email: echo "sbs@sbsrearg.pbz" | sed 's/s/o/g' | rot13
All posts from Google Groups are auto-killed.
Solved - (was Re: [slrn] Display all threads that contain unread messages)
#226378
Author: Bob Cortopassi
Date: Sat, 27 Sep 2008 06:44
45 lines
2422 bytes
On 2008-09-25, Erik Hahn <erik_hahn@replyto.invalid> wrote:
> The page at http://tinyurl.com/477j9r (Google Cache, it isn't available
> at the original place anymore) claims that you could use a macro to
> display all threads fully that contain at least one unread message. Does
> such a macro already exist or could someone create it (I don't know
> s-lang)?

define get_all_parents ()
{
   collapse_threads();

   do
   {
      call("toggle_header_tag");
   } while (header_down(1));

   do
   {
      call("toggle_header_tag");
      set_prefix_argument(1);
      call("get_parent_header");
   } while (prev_tagged_header());

   uncollapse_threads();
}

definekey ("get_all_parents", "w", "article");

If you're happy with this (warning!! it can be slow) then you can call
it automatically on group entry by something like:

define article_mode_hook()
{
   get_all_parents();
}

There's likely a more efficient way of doing this, but I've had enough
chasing for one night. 

Regards,
Bob

-- 
email: echo "sbs@sbsrearg.pbz" | sed 's/s/o/g' | rot13
All posts from Google Groups are auto-killed.
Re: Solved - (was Re: [slrn] Display all threads that contain unread messages)
#226383
Author: Erik Hahn
Date: Sat, 27 Sep 2008 12:07
14 lines
1701 bytes
On 2008-09-27, Bob Cortopassi <bobernet@nsa.invalid> wrote:
> There's likely a more efficient way of doing this, but I've had enough
> chasing for one night. 
Thanks for your efforts, unfortunately it doesn't work, though. When I
press the w key, it expands a random thread, and messes up the screen.
This is what it says in the status bar:

Linking articles with identical subjects ...Traceback: call
/usr/share/slrn/macros/thread.sl:14:get_all_parents:Run-Time Error

	-Erik

-- 
hackerkey://v4sw5hw2ln3pr5ck0ma2u7LwXm4l7Gi2e2t4b7Ken4/7a16s0r1p-5.62/-6.56g5OR
Re: Solved - (was Re: [slrn] Display all threads that contain unread messages)
#226382
Author: Bob Cortopassi
Date: Sat, 27 Sep 2008 14:58
23 lines
2239 bytes
On 2008-09-27, Erik Hahn <erik_hahn@replyto.invalid> wrote:
> On 2008-09-27, Bob Cortopassi <bobernet@nsa.invalid> wrote:
>> There's likely a more efficient way of doing this, but I've had enough
>> chasing for one night. 
> Thanks for your efforts, unfortunately it doesn't work, though. When I
> press the w key, it expands a random thread, and messes up the screen.
> This is what it says in the status bar:
>
> Linking articles with identical subjects ...Traceback: call
> /usr/share/slrn/macros/thread.sl:14:get_all_parents:Run-Time Error

It works here.

I'll show you mine, if you show me yours?

$ slrn --version
slrn pre0.9.9-111
* Note: This version is a developer preview.
S-Lang Library Version: 2.1.3

-- 
email: echo "sbs@sbsrearg.pbz" | sed 's/s/o/g' | rot13
All posts from Google Groups are auto-killed.
Re: Solved - (was Re: [slrn] Display all threads that contain unread messages)
#226385
Author: Erik Hahn
Date: Sat, 27 Sep 2008 15:19
22 lines
1795 bytes
On 2008-09-27, Bob Cortopassi <bobernet@nsa.invalid> wrote:
> It works here.
>
> I'll show you mine, if you show me yours?
>
> $ slrn --version
> slrn pre0.9.9-111
> * Note: This version is a developer preview.
> S-Lang Library Version: 2.1.3

slrn --version
Warning: couldn't set locale.
Slrn 0.9.8.1pl1 [2005-02-17]
	* Note: This version is a developer preview.
S-Lang Library Version: 2.1.3

I got that version regularily from Gentoo portage, it's even marked as
stable.

	-Erik
-- 
hackerkey://v4sw5hw2ln3pr5ck0ma2u7LwXm4l7Gi2e2t4b7Ken4/7a16s0r1p-5.62/-6.56g5OR
Re: [slrn] Display all threads that contain unread messages
#226387
Author: John E. Davis
Date: Sat, 27 Sep 2008 17:00
90 lines
3621 bytes
On Thu, 25 Sep 2008 22:51:18 +0200, Erik Hahn <erik_hahn@replyto.invalid>
wrote:
> The page at http://tinyurl.com/477j9r (Google Cache, it isn't available
> at the original place anymore) claims that you could use a macro to
> display all threads fully that contain at least one unread message. Does
> such a macro already exist or could someone create it (I don't know
> s-lang)?

Below you will find a function that does this from group-mode.  I
implemented it in this fashion because querying the server via
message-ids can be expensive and I feel that it is more efficient just
to grab all the available headers from the server and then keep only
those desired.

Use, e.g.,

  setkey group select_group_unread_threads "X"

in your .slrnrc file to bind it to "X" in group mode.

FWIW, I prefer to see just the unread articles and manually
reconstruct the thread if I want to see the previously read messages
of the thread.

Good luck, --John

#v+

% Returns 0 if at the last header, otherwise it returns 1
private define header_eobp ()
{
   return not header_up (header_down (1));
}

define select_group_unread_threads ()
{
   ungetkey ('\r');
   set_prefix_argument (1);
   if (-1 == select_group ())
     return;

   uncollapse_threads ();
   call ("header_bob");
   
   variable header_flags = Assoc_Type[];
   
   while (not header_eobp ())
     {
	% Current header starts a thread tree.
	variable num_unread = 0;
	variable num_processed = 0;
	do
	  {
	     variable flags = get_header_flags ();
	     header_flags[extract_article_header ("Message-ID")] = flags;
	     ifnot (flags & HEADER_READ)
	       num_unread++;
	     num_processed++;
	  }
	while (header_down(1) && has_parent ());
	if (num_unread)
	  {
	     %  goto top of thread and undelete it
	     () = header_up (num_processed-1);
	     collapse_thread ();
	     call ("undelete");   %  undeletes and moves position down
	  }
     }
   % The above loop will not have processed the last header if it was
   % not part of a thead.  Handle that here.
   ifnot (is_thread_collapsed ())
     header_flags[extract_article_header ("Message-ID")] = get_header_flags ();

   % At this point, threads with at least one unread header is marked as
   % unread, and all others are marked as read.  Get rid of the others.
   call ("expunge");
   
   call ("header_bob");
   uncollapse_threads ();
   do
     {
	set_header_flags (header_flags[extract_article_header("Message-ID")]);
     }
   while (header_down (1));
   
   collapse_threads ();
   call ("header_bob");
}

#v-
Re: [slrn] Display all threads that contain unread messages
#226397
Author: Erik Hahn
Date: Sat, 27 Sep 2008 22:15
16 lines
1885 bytes
On 2008-09-27, John E. Davis <jed@jedsoft.org> wrote:
> Below you will find a function that does this from group-mode.  I
> implemented it in this fashion because querying the server via
> message-ids can be expensive and I feel that it is more efficient just
> to grab all the available headers from the server and then keep only
> those desired.
Thanks, it works. Excactly what I wanted.

> FWIW, I prefer to see just the unread articles and manually
> reconstruct the thread if I want to see the previously read messages
> of the thread.
How do you do that? Is there a way to manually add messages to the
displayed ones or do you just switch to "full" mode?

-- 
hackerkey://v4sw5hw2ln3pr5ck0ma2u7LwXm4l7Gi2e2t4b7Ken4/7a16s0r1p-5.62/-6.56g5OR
Re: [slrn] Display all threads that contain unread messages
#226399
Author: Erik Hahn
Date: Sat, 27 Sep 2008 23:06
25 lines
2072 bytes
On 2008-09-27, John E. Davis <jed@jedsoft.org> wrote:
> Below you will find a function that does this from group-mode.  I
> implemented it in this fashion because querying the server via
> message-ids can be expensive and I feel that it is more efficient just
> to grab all the available headers from the server and then keep only
> those desired.
That mostly works, but often I get (status bar):

/usr/share/slrn/macros/jedthread.sl:50:select_group_unread_threads:Run-Time
Error
call: header_bob not in current keymap.

> FWIW, I prefer to see just the unread articles and manually
> reconstruct the thread if I want to see the previously read messages
> of the thread.
How do you do that? Is there a way to manually add specific messages to
the displayed ones or do you simply switch to "full mode"?

> Good luck, --John
Thanks.

	-Erik

-- 
hackerkey://v4sw5hw2ln3pr5ck0ma2u7LwXm4l7Gi2e2t4b7Ken4/7a16s0r1p-5.62/-6.56g5OR
Re: [slrn] Display all threads that contain unread messages
#226400
Author: John E. Davis
Date: Sat, 27 Sep 2008 23:12
31 lines
2115 bytes
On Sun, 28 Sep 2008 00:15:55 +0200, Erik Hahn <erik_hahn@replyto.invalid>
wrote:
[...]
> Thanks, it works. Excactly what I wanted.

It might also be a good idea to upgrade to the latest version, which
is 0.9.9p1.  The version that you are using is known to have a number
of bugs.

>> FWIW, I prefer to see just the unread articles and manually
>> reconstruct the thread if I want to see the previously read messages
>> of the thread.
> How do you do that? Is there a way to manually add messages to the
> displayed ones or do you just switch to "full" mode?

Use "ESC 2 ESC p" or "ESC 1 ESC p".  You can wrap one of these
combinations in a function that can be called from article mode:

   define reconstruct_this_thread ()
   {
      set_prefix_argument (2);
      call ("get_parent_header");
   }

I believe that you can also put this in your .slrnrc file:

 setkey article "set_prefix_argument(2);call(\"get_parent_header\");" "KEY"

where "KEY" represents the desired key-sequence.

--John
Re: [slrn] Display all threads that contain unread messages
#226398
Author: John E. Davis
Date: Sat, 27 Sep 2008 23:22
18 lines
1546 bytes
On Sun, 28 Sep 2008 01:06:26 +0200, Erik Hahn <erik_hahn@replyto.invalid>
wrote:
> That mostly works, but often I get (status bar):
>
> /usr/share/slrn/macros/jedthread.sl:50:select_group_unread_threads:Run-Time
> Error
> call: header_bob not in current keymap.

Try changing the line in the select_group_unread_threads function from

   if (-1 == select_group ())

to

   if ((-1 == select_group () || (is_group_mode ()))

Thanks,
--John
Re: [slrn] Display all threads that contain unread messages
#226416
Author: Erik Hahn
Date: Sun, 28 Sep 2008 21:13
19 lines
1809 bytes
On 2008-09-27, John E. Davis <jed@jedsoft.org> wrote:
> Use "ESC 2 ESC p" or "ESC 1 ESC p".  You can wrap one of these
> combinations in a function that can be called from article mode:
>
>    define reconstruct_this_thread ()
>    {
>       set_prefix_argument (2);
>       call ("get_parent_header");
>    }
>
> I believe that you can also put this in your .slrnrc file:
>
>  setkey article "set_prefix_argument(2);call(\"get_parent_header\");" "KEY"
Done that, works perfectly. What's the difference between using 1 and 2?

	-Erik

-- 
hackerkey://v4sw5hw2ln3pr5ck0ma2u7LwXm4l7Gi2e2t4b7Ken4/7a16s0r1p-5.62/-6.56g5OR
Re: [slrn] Display all threads that contain unread messages
#226422
Author: Peter J Ross
Date: Sun, 28 Sep 2008 23:21
31 lines
2509 bytes
In news.software.readers on Sun, 28 Sep 2008 23:13:45 +0200, Erik Hahn
<erik_hahn@replyto.invalid> wrote:

> On 2008-09-27, John E. Davis <jed@jedsoft.org> wrote:
>> Use "ESC 2 ESC p" or "ESC 1 ESC p".  You can wrap one of these
>> combinations in a function that can be called from article mode:
>>
>>    define reconstruct_this_thread ()
>>    {
>>       set_prefix_argument (2);
>>       call ("get_parent_header");
>>    }
>>
>> I believe that you can also put this in your .slrnrc file:
>>
>>  setkey article "set_prefix_argument(2);call(\"get_parent_header\");" "KEY"
> Done that, works perfectly. What's the difference between using 1 and 2?

1 works even if some message-ids are missing from the References line.

2 is faster but less thorough.

This is all explained in the FAQ and manual, both of which I recommend.



-- 
PJR :-)
slrn newsreader (v0.9.9): http://slrn.sourceforge.net/
extra slrn documentation: http://slrn-doc.sourceforge.net/
newsgroup name validator: http://pjr.lasnobberia.net/usenet/validator
Re: [slrn] Display all threads that contain unread messages
#228146
Author: andrew
Date: Sun, 21 Dec 2008 23:30
14 lines
1471 bytes
On 2008-09-25, Erik Hahn <erik_hahn@replyto.invalid> wrote:

> The page at http://tinyurl.com/477j9r (Google Cache, it isn't available
> at the original place anymore) 

This page can be viewed here:

http://slrn.sourceforge.net/docs/slrn-FAQ-3.html#ss3.2

  Andrew

-- 
echo 'hfrarg.naqerj@tznvy.pbz' | \
tr 'A-M N-Z a-m n-z' 'N-Z A-M n-z a-m'
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads