• slrn: Sort most recently active threads first?

    From Jay@21:1/5 to All on Wed Jun 16 12:01:38 2021
    Is there a way in slrn to sort the most "recently active" threads first? So if a
    collapsed thread has been replied to today, I want it to show up high on the list, even if the oldest unread message in the thread was posted weeks ago.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tavis Ormandy@21:1/5 to Jay on Thu Jun 17 15:30:52 2021
    On 2021-06-16, Jay wrote:
    Is there a way in slrn to sort the most "recently active" threads first? So if a
    collapsed thread has been replied to today, I want it to show up high on the list, even if the oldest unread message in the thread was posted weeks ago.

    I think you're looking for `set sorting_method 9`.

    Here is the full list of sorting methods, if you're interested:

    0 do not sort
    1 perform threading
    2 sort by subject
    3 thread, then sort by subject
    4 sort by score
    5 thread, then sort by score
    6 sort by score, then by subject
    7 thread, then sort by score and subject
    8 sort by date with most recent first
    9 thread, then sort by date with most recent first
    10 sort by date with most recent last
    11 thread, then sort by date with most recent last
    12 custom sorting

    Tavis.


    --
    _o) $ lynx lock.cmpxchg8b.com
    /\\ _o) _o) $ finger taviso@sdf.org
    _\_V _( ) _( ) @taviso

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jay@21:1/5 to Tavis Ormandy on Thu Jun 17 10:35:28 2021
    On 2021-06-17, Tavis Ormandy <taviso@gmail.com> wrote:
    On 2021-06-16, Jay wrote:
    Is there a way in slrn to sort the most "recently active" threads first? So >> if a collapsed thread has been replied to today, I want it to show up high on
    the list, even if the oldest unread message in the thread was posted weeks >> ago.

    I think you're looking for `set sorting_method 9`.

    Here is the full list of sorting methods, if you're interested:

    0 do not sort
    1 perform threading
    2 sort by subject
    3 thread, then sort by subject
    4 sort by score
    5 thread, then sort by score
    6 sort by score, then by subject
    7 thread, then sort by score and subject
    8 sort by date with most recent first
    9 thread, then sort by date with most recent first
    10 sort by date with most recent last
    11 thread, then sort by date with most recent last
    12 custom sorting

    Tavis.

    Thanks. That doesn't quite work; it still sorts by the date of the highest ancestor of a thread, not by the most recent message in any given thread.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tavis Ormandy@21:1/5 to Jay on Thu Jun 17 18:58:41 2021
    On 2021-06-17, Jay wrote:
    Thanks. That doesn't quite work; it still sorts by the date of the highest ancestor of a thread, not by the most recent message in any given thread.

    Ah, I don't think that's possible.

    There is no sorting hook, so you can't override how articles are
    compared with macros, it's all hardcoded.

    It would be nice if you could write an article_mode_hook that changes
    the date, but you can't do anything like replace_article() then AFAIK.

    Wait... LOL.. just as I was writing this reply saying it was impossible,
    I realized how you could do it. It's a weird solution, so be prepared :-)

    You can't alter articles in article_mode_hook, but you can adjust the
    score. What if you temporarily set the score of each article to the
    unixtime it was sent, sort it, then change it back? Slrn automatically propogates the highest score to the thread, then you can sort by score before reapplying the old scores.

    Believe it or not, I think this works!

    Try the macro below.

    Tavis.

    define score_child_date ()
    {
    variable score = Assoc_Type[Int_Type, 0];
    variable flags = Assoc_Type[Int_Type, 0];
    variable date;
    variable meth;
    variable mid;

    uncollapse_threads();
    header_bob();

    do {
    date = extract_article_header("Date");
    mid = extract_article_header("Message-ID");
    score[mid] = get_header_score();
    flags[mid] = get_header_flags();
    set_header_score(datestring_to_unixtime(date));
    } while (header_down(1) == 1);

    meth = get_variable_value("sorting_method");
    set_integer_variable("sorting_method", 5);
    sort_by_sorting_method();
    uncollapse_threads();

    set_integer_variable("sorting_method", meth);

    header_bob();

    do {
    mid = extract_article_header("Message-ID");
    set_header_score(score[mid]);
    set_header_flags(flags[mid]);
    } while (header_down(1) == 1);

    header_bob();
    collapse_threads();
    }

    () = register_hook("article_mode_startup_hook", "score_child_date");


    --
    _o) $ lynx lock.cmpxchg8b.com
    /\\ _o) _o) $ finger taviso@sdf.org
    _\_V _( ) _( ) @taviso

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tavis Ormandy@21:1/5 to Tavis Ormandy on Thu Jun 17 23:19:11 2021
    On 2021-06-17, Tavis Ormandy wrote:
    On 2021-06-17, Jay wrote:
    Thanks. That doesn't quite work; it still sorts by the date of the highest >> ancestor of a thread, not by the most recent message in any given thread.

    You can't alter articles in article_mode_hook, but you can adjust the
    score. What if you temporarily set the score of each article to the
    unixtime it was sent, sort it, then change it back?

    I made some improvements:

    - Using UNIX time works but doesn't handle timezones. A better idea
    is to make slrn sort it then reuse whatever index it assigns the message.
    - It turns out sorting updates the flags displayed, so they were out
    of sync.

    I've been using it today, I kinda like it.

    I think you just need this in your .slrnrc:

    interpret "util.sl"
    interpret "/path/to/this/macro.sl"

    Then save the following macro somewhere.

    define score_child_date ()
    {
    variable score = Assoc_Type[Int_Type, 0];
    variable flags = Assoc_Type[Int_Type, 0];
    variable mid;
    variable num = 0;

    set_integer_variable("sorting_method", 10);
    sort_by_sorting_method();

    header_bob();

    do {
    mid = extract_article_header("Message-ID");
    score[mid] = get_header_score();
    flags[mid] = get_header_flags();
    set_header_score(num);
    set_header_flags(flags[mid]);
    num = num + 1;
    } while (header_down(1) == 1);

    set_integer_variable("sorting_method", 5);
    sort_by_sorting_method();
    uncollapse_threads();

    header_bob();

    do {
    mid = extract_article_header("Message-ID");
    set_header_score(score[mid]);
    set_header_flags(flags[mid]);
    } while (header_down(1) == 1);

    header_bob();
    collapse_threads();
    }

    () = register_hook("article_mode_startup_hook", "score_child_date");

    --
    _o) $ lynx lock.cmpxchg8b.com
    /\\ _o) _o) $ finger taviso@sdf.org
    _\_V _( ) _( ) @taviso

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bolloy Benders Family@21:1/5 to Jay on Thu Jun 17 20:25:00 2021
    On Thu, 17 Jun 2021 10:35:28 -0500, Jay <jay@jay.xyz> wrote:

    S sort by date with most recent last

    Thanks. That doesn't quite work; it still sorts by the date of the highest >ancestor of a thread, not by the most recent message in any given thread.

    This will do what you want. This won't thread posts.

    Enter the newsgroup then press the "escape" key then "s" key and then
    the "A" key.

    ESC -> s -> A

    If you want the newsgroup subject list sorted so that the latest date
    is displayed at the top of the subject list:

    ESC -> s -> 8

    --

    )" .
    / \ (\-./
    / | _/ o. \
    | | .-" y)-
    | |/ _/ \
    \ /j _".\(@)
    \ ( | `.'' )
    \ _`- | /
    " `-._ <_ (
    `-.,),)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tavis Ormandy@21:1/5 to Bolloy Benders Family on Fri Jun 18 04:12:06 2021
    On 2021-06-18, Bolloy Benders Family wrote:
    On Thu, 17 Jun 2021 10:35:28 -0500, Jay <jay@jay.xyz> wrote:

    S sort by date with most recent last

    Thanks. That doesn't quite work; it still sorts by the date of the highest >>ancestor of a thread, not by the most recent message in any given thread.

    This will do what you want. This won't thread posts.


    I think the question is how to sort threads by most recent activity.

    e.g.

    Thread A [1st Jan]
    - Re: Thread A [2nd Jan]
    Thread B [2nd Jan]
    - Re: Thread B [3rd Jan]

    Thread B should come first, because it has more recent activity. I think
    a macro is necessary.

    Tavis.

    --
    _o) $ lynx lock.cmpxchg8b.com
    /\\ _o) _o) $ finger taviso@sdf.org
    _\_V _( ) _( ) @taviso

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jay@21:1/5 to Tavis Ormandy on Fri Jun 18 08:43:34 2021
    On 2021-06-17, Tavis Ormandy <taviso@gmail.com> wrote:
    On 2021-06-17, Tavis Ormandy wrote:
    On 2021-06-17, Jay wrote:
    Thanks. That doesn't quite work; it still sorts by the date of the highest >>> ancestor of a thread, not by the most recent message in any given thread. >>
    You can't alter articles in article_mode_hook, but you can adjust the
    score. What if you temporarily set the score of each article to the
    unixtime it was sent, sort it, then change it back?

    I made some improvements:

    - Using UNIX time works but doesn't handle timezones. A better idea
    is to make slrn sort it then reuse whatever index it assigns the
    message.
    - It turns out sorting updates the flags displayed, so they were out
    of sync.

    I've been using it today, I kinda like it.

    Thanks!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lewis@21:1/5 to Lewis on Sat Jun 26 11:44:34 2021
    In message <slrnsde4f2.1pp7.g.kreme@m1mini.local> Lewis <g.kreme@kreme.dont-email.me> wrote:
    In message <ij23jfFhbdnU1@mid.individual.net> Tavis Ormandy <taviso@gmail.com> wrote:
    I made some improvements:

    - Using UNIX time works but doesn't handle timezones. A better idea
    is to make slrn sort it then reuse whatever index it assigns the message.
    - It turns out sorting updates the flags displayed, so they were out
    of sync.

    I've been using it today, I kinda like it.

    I think you just need this in your .slrnrc:

    interpret "util.sl"
    interpret "/path/to/this/macro.sl"

    Then save the following macro somewhere.

    Once this is done, does the macro just run when a group is loaded? I
    don't see what it is doing when I load a group.

    This is what a group looks like when loading the macro:

    https://imgur.com/9AVgqKJ


    --
    The Steve is seen, rightly or wrongly, as the visionary, the leader,
    the savant. Bill is the Boswell to The Steve's Johnson, but
    lacking Boswell's wit, charm, and dynamic personality.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lewis@21:1/5 to Tavis Ormandy on Sat Jun 26 11:39:14 2021
    In message <ij23jfFhbdnU1@mid.individual.net> Tavis Ormandy <taviso@gmail.com> wrote:
    I made some improvements:

    - Using UNIX time works but doesn't handle timezones. A better idea
    is to make slrn sort it then reuse whatever index it assigns the message.
    - It turns out sorting updates the flags displayed, so they were out
    of sync.

    I've been using it today, I kinda like it.

    I think you just need this in your .slrnrc:

    interpret "util.sl"
    interpret "/path/to/this/macro.sl"

    Then save the following macro somewhere.

    Once this is done, does the macro just run when a group is loaded? I
    don't see what it is doing when I load a group.

    --
    With the exception of the wit and wisdom of Calvin and Hobbes, not much lasts forever.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lis Khittan@21:1/5 to All on Mon Aug 2 14:50:15 2021
    Thanks so much Tavis. I am looking for a solution to this for years.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)