#iffalse fullthreads.sl - enter group and show full threads $Id: fullthreads.sl,v 42836be7d7be 2010-01-12 08:44 +0100 blacktrash $ Copyright (C) 2010 Christian Ebert This macro offers an answer to "I want to see full threads as soon as they contain at least one unread article." "Can slrn do this?" from http://www.slrn.org/docs/slrn-FAQ-3.html until the functionality is implemented in a generic way. Works best with a local spool as the server has to be queried. Needs a server with the XPAT extension for consistent results. See note in manual.txt on get_children_headers. #endif implements ("fullthreads"); static define enter_fullthreads () { variable next = 1, show_article = get_variable_value ("show_article"); set_integer_variable ("show_article", 0); call ("select_group"); collapse_threads (); set_prefix_argument (1); while (next > 0) { try { call ("get_parent_header"); } catch AnyError; collapse_thread (); next = header_down (1); } reset_prefix_arg (); call ("header_bob"); uncollapse_threads (); % if first header is read jump to first unread article if (get_header_flags () mod 2) header_next_unread (); if (show_article) call ("hide_article"); set_integer_variable ("show_article", show_article); } definekey ("fullthreads->enter_fullthreads", "", "group");