mhonarc-users

patch: improved TSLICE, thread navigation, ...

2001-06-25 00:07:48
Hi,

Thank you all very much for MHonArc! It is great.

I've made several changes to the source that other people may find useful.
The source patches are ready; I haven't updated the documentation yet, but
I'm happy to if the patches are accepted. I'm not sure if there is some
protocol for submitting things like this, so here they are.

The changes are:

- Thread navigation updates:

  - Navigations TNEXT and TPREV now work chronologically, even if TREVERSE
    is on. Previously, if TREVERSE was on, TNEXT would move chronologically
    forward within a thread, but chronologically backwards between threads.
    The new behavior is more like NEXT and PREV and more intuitively
    sensible.

  - Add new navigation values TNEXTTOP, TPREVTOP, TNEXTIN, and TPREVIN, and
    corresponding resources like TNEXTTOPBUTTON, etc. TNEXTTOP moves to the
    start of the next thread, TPREVTOP to the start of the previous thread.
    TNEXTIN moves to the next message within the current thread, TPREVIN to
    the previous message within the current thread. (TPREVIN and TNEXTIN
    are just like TPREV and TNEXT, except that they become undefined for
    the first/last message in a thread, so the T...IA resource is used.)

- TSLICE updates:

  - New resources TSINGLETXTCUR, TTOPBEGINCUR, and TLITXTCUR are used to
    display the current message in a thread slice. These resources default
    to the values of TSINGLETXT, TTOPBEGIN, and TLITXT, respectively. Using
    these resources, you can highlight the current message's position in a
    thread slice -- for example, by changing its color, or not making it a
    link.

  - Add TSLICECURTHREAD/NOTSLICECURTHREAD resource. If TSLICECURTHREAD is
    on, then thread slices are limited to the thread containing the current
    message. Default is no.

  - Add optional arguments to $TSLICE$. $TSLICE(10;30;1)$ gives a thread
    slice with 10 messages before CUR, 30 messages after CUR, and with
    TSLICECURTHREAD on.

- Add SUBJECTNOTHREADRXP resource. This regular expression prevents
  messages from being threaded by subject. I set it to "^No Subject$|^$",
  so that messages without a subject are never marked as "Possible
  follow-up(s)" to one another. Default regexp matches no messages.

- Change AUTHSORT and SUBSORT so they sort messages by reverse
  chronological order within author/subject groupings, but the groupings
  remain in alphabetical order. This seems more generally useful. (But this
  behavior could be controlled through some resource.)

- MHonArc additionally searches for OTHERINDEXES files in the directory
  containing the main rcfile.

I included the full patch below.

What do people think?

Thanks,
Eddie Kohler

Only in MHonArc2.4.9-p: Makefile
diff -c -r MHonArc2.4.9/lib/mhamain.pl MHonArc2.4.9-p/lib/mhamain.pl
*** MHonArc2.4.9/lib/mhamain.pl Sun Jun 10 16:11:25 2001
--- MHonArc2.4.9-p/lib/mhamain.pl       Sun Jun 24 09:33:48 2001
***************
*** 594,617 ****
  
        ## find other index resource file
        IDXFIND: {
!           if (! -e $rc) {
!               $rcfile = join($DIRSEP, $OUTDIR, $rc);
!               if (! -e $rcfile) {
!                   # look thru @INC to find file
!                   local($_);
!                   foreach (@INC) {
!                       $rcfile = join($DIRSEP, $_, $rc);
!                       if (-e $rcfile) {
!                           last IDXFIND;
!                       }
!                   }
!                   warn qq/Warning: Unable to find resource file "$rc"\n/;
!                   next OTHERIDX;
!               }
  
!           } else {
!               $rcfile = $rc;
            }
        }
            
        ## read resource file and print index
--- 594,617 ----
  
        ## find other index resource file
        IDXFIND: {
!           $rcfile = $rc;
!           last IDXFIND if -e $rcfile;
!           $rcfile = join($DIRSEP, $OUTDIR, $rc);
!           last IDXFIND if -e $rcfile;
!           $rcfile = $MainPathhead . $rc
!               if $MainPathhead && ($rc !~ /$DIRSEPREX/o);
!           last IDXFIND if -e $rcfile;
  
!           # look thru @INC to find file
!           local($_);
!           foreach (@INC) {
!               $rcfile = join($DIRSEP, $_, $rc);
!               if (-e $rcfile) {
!                   last IDXFIND;
!               }
            }
+           warn qq/Warning: Unable to find resource file "$rc"\n/;
+           next OTHERIDX;
        }
            
        ## read resource file and print index
diff -c -r MHonArc2.4.9/lib/mhdb.pl MHonArc2.4.9-p/lib/mhdb.pl
*** MHonArc2.4.9/lib/mhdb.pl    Sun Jun 10 16:11:24 2001
--- MHonArc2.4.9-p/lib/mhdb.pl  Sun Jun 24 18:26:32 2001
***************
*** 147,152 ****
--- 147,153 ----
  print_var(\*DB,'POSIXstrftime',  \$POSIXstrftime);
  print_var(\*DB,'THREAD',         \$THREAD);
  print_var(\*DB,'SubArtRxp',      \$SubArtRxp);
+ print_var(\*DB,'SubNoThreadRxp', \$SubNoThreadRxp);
  print_var(\*DB,'SubReplyRxp',    \$SubReplyRxp);
  print_var(\*DB,'SubStripCode',   \$SubStripCode);
  print_var(\*DB,'UseLocalTime',   \$UseLocalTime);
***************
*** 205,210 ****
--- 206,212 ----
  print_var(\*DB,'TLINONE',      \$TLINONE) unless $IsDefault{'TLINONE'};
  print_var(\*DB,'TLINONEEND',   \$TLINONEEND) unless $IsDefault{'TLINONEEND'};
  print_var(\*DB,'TLITXT',       \$TLITXT) unless $IsDefault{'TLITXT'};
+ print_var(\*DB,'TLITXTCUR',    \$TLITXTCUR) unless $IsDefault{'TLITXTCUR'};
  print_var(\*DB,'TNEXTPGLINK',  \$TNEXTPGLINK) unless 
$IsDefault{'TNEXTPGLINK'};
  print_var(\*DB,'TNEXTPGLINKIA',\$TNEXTPGLINKIA)
                                unless $IsDefault{'TNEXTPGLINKIA'};
***************
*** 212,223 ****
--- 214,228 ----
  print_var(\*DB,'TPREVPGLINKIA',\$TPREVPGLINKIA)
                                unless $IsDefault{'TPREVPGLINKIA'};
  print_var(\*DB,'TSINGLETXT',   \$TSINGLETXT) unless $IsDefault{'TSINGLETXT'};
+ print_var(\*DB,'TSINGLETXTCUR',\$TSINGLETXTCUR)
+                               unless $IsDefault{'TSINGLETXTCUR'};
  print_var(\*DB,'TSUBJECTBEG',  \$TSUBJECTBEG) unless 
$IsDefault{'TSUBJECTBEG'};
  print_var(\*DB,'TSUBJECTEND',  \$TSUBJECTEND) unless 
$IsDefault{'TSUBJECTEND'};
  print_var(\*DB,'TSUBLISTBEG',  \$TSUBLISTBEG) unless 
$IsDefault{'TSUBLISTBEG'};
  print_var(\*DB,'TSUBLISTEND',  \$TSUBLISTEND) unless 
$IsDefault{'TSUBLISTEND'};
  print_var(\*DB,'TTITLE',       \$TTITLE);
  print_var(\*DB,'TTOPBEG',      \$TTOPBEG) unless $IsDefault{'TTOPBEG'};
+ print_var(\*DB,'TTOPBEGCUR',   \$TTOPBEGCUR) unless $IsDefault{'TTOPBEGCUR'};
  print_var(\*DB,'TTOPEND',      \$TTOPEND) unless $IsDefault{'TTOPEND'};
  
  ## Other resources
***************
*** 260,275 ****
--- 265,314 ----
                                unless $IsDefault{'TNEXTBUTTONIA'};
  print_var(\*DB,'TNEXTLINK',    \$TNEXTLINK) unless $IsDefault{'TNEXTLINK'};
  print_var(\*DB,'TNEXTLINKIA',  \$TNEXTLINKIA) unless 
$IsDefault{'TNEXTLINKIA'};
+ print_var(\*DB,'TNEXTINBUTTON',\$TNEXTINBUTTON)
+                               unless $IsDefault{'TNEXTINBUTTON'};
+ print_var(\*DB,'TNEXTINBUTTONIA',\$TNEXTINBUTTONIA)
+                               unless $IsDefault{'TNEXTINBUTTONIA'};
+ print_var(\*DB,'TNEXTINLINK', \$TNEXTINLINK)
+                               unless $IsDefault{'TNEXTINLINK'};
+ print_var(\*DB,'TNEXTINLINKIA', \$TNEXTINLINKIA)
+                               unless $IsDefault{'TNEXTINLINKIA'};
+ print_var(\*DB,'TNEXTTOPBUTTON',\$TNEXTTOPBUTTON)
+                               unless $IsDefault{'TNEXTTOPBUTTON'};
+ print_var(\*DB,'TNEXTTOPBUTTONIA',\$TNEXTTOPBUTTONIA)
+                               unless $IsDefault{'TNEXTTOPBUTTONIA'};
+ print_var(\*DB,'TNEXTTOPLINK', \$TNEXTTOPLINK)
+                               unless $IsDefault{'TNEXTTOPLINK'};
+ print_var(\*DB,'TNEXTTOPLINKIA', \$TNEXTTOPLINKIA)
+                               unless $IsDefault{'TNEXTTOPLINKIA'};
  print_var(\*DB,'TOPLINKS',     \$TOPLINKS) unless $IsDefault{'TOPLINKS'};
  print_var(\*DB,'TPREVBUTTON',  \$TPREVBUTTON) unless 
$IsDefault{'TPREVBUTTON'};
  print_var(\*DB,'TPREVBUTTONIA',\$TPREVBUTTONIA)
                                unless $IsDefault{'TPREVBUTTONIA'};
  print_var(\*DB,'TPREVLINK',    \$TPREVLINK) unless $IsDefault{'TPREVLINK'};
  print_var(\*DB,'TPREVLINKIA',  \$TPREVLINKIA) unless 
$IsDefault{'TPREVLINKIA'};
+ print_var(\*DB,'TPREVINBUTTON',\$TPREVINBUTTON)
+                               unless $IsDefault{'TPREVINBUTTON'};
+ print_var(\*DB,'TPREVINBUTTONIA',\$TPREVINBUTTONIA)
+                               unless $IsDefault{'TPREVINBUTTONIA'};
+ print_var(\*DB,'TPREVINLINK', \$TPREVINLINK)
+                               unless $IsDefault{'TPREVINLINK'};
+ print_var(\*DB,'TPREVINLINKIA', \$TPREVINLINKIA)
+                               unless $IsDefault{'TPREVINLINKIA'};
+ print_var(\*DB,'TPREVTOPBUTTON',\$TPREVTOPBUTTON)
+                               unless $IsDefault{'TPREVTOPBUTTON'};
+ print_var(\*DB,'TPREVTOPBUTTONIA',\$TPREVTOPBUTTONIA)
+                               unless $IsDefault{'TPREVTOPBUTTONIA'};
+ print_var(\*DB,'TPREVTOPLINK', \$TPREVTOPLINK)
+                               unless $IsDefault{'TPREVTOPLINK'};
+ print_var(\*DB,'TPREVTOPLINKIA', \$TPREVTOPLINKIA)
+                               unless $IsDefault{'TPREVTOPLINKIA'};
  print_var(\*DB,'TSLICEBEG',    \$TSLICEBEG) unless $IsDefault{'TSLICEBEG'};
  print_var(\*DB,'TSLICEEND',    \$TSLICEEND) unless $IsDefault{'TSLICEEND'};
  print_var(\*DB,'TSliceNBefore',\$TSliceNBefore);
  print_var(\*DB,'TSliceNAfter', \$TSliceNAfter);
+ print_var(\*DB,'TSLICECURTHREAD', \$TSLICECURTHREAD)
+                               unless $IsDefault{'TSLICECURTHREAD'};
  print_var(\*DB,'UMASK',              \$UMASK);
  
  }
diff -c -r MHonArc2.4.9/lib/mhidxrc.pl MHonArc2.4.9-p/lib/mhidxrc.pl
*** MHonArc2.4.9/lib/mhidxrc.pl Sat Oct 28 09:29:49 2000
--- MHonArc2.4.9-p/lib/mhidxrc.pl       Sat Jun 23 08:58:17 2001
***************
*** 170,175 ****
--- 170,180 ----
  EndOfStr
        $IsDefault{'TSINGLETXT'} = 1;
      }
+     ## Template for thread entry with no follow-ups, cur msg
+     unless ($TSINGLETXTCUR) {
+       $TSINGLETXTCUR = $TSINGLETXT;
+       $IsDefault{'TSINGLETXTCUR'} = 1;
+     }
  
      ## Template for thread entry that is the start of a thread
      unless ($TTOPBEG) {
***************
*** 179,184 ****
--- 184,194 ----
  EndOfStr
        $IsDefault{'TTOPBEG'} = 1;
      }
+     ## Template for thread entry that is the start of a thread, cur msg
+     unless ($TTOPBEGCUR) {
+       $TTOPBEGCUR = $TTOPBEG;
+       $IsDefault{'TTOPBEGCUR'} = 1;
+     }
      ## Template for end of a thread
      unless ($TTOPEND) {
        $TTOPEND = "</li>\n";
***************
*** 204,209 ****
--- 214,224 ----
  EndOfStr
        $IsDefault{'TLITXT'} = 1;
      }
+     ## Template for the start and content of a regular thread entry for cur 
msg
+     unless ($TLITXTCUR) {
+       $TLITXTCUR = $TLITXT;
+       $IsDefault{'TLITXTCUR'} = 1;
+     }
      ## Template for end of a regular thread entry
      unless ($TLIEND) {
        $TLIEND = "</li>\n";
***************
*** 267,272 ****
--- 282,291 ----
      $TSLICEEND = "</ul></blockquote>\n";
      $IsDefault{'TSLICEEND'} = 1;
  }
+ unless ($TSLICECURTHREAD ne '') {
+     $TSLICECURTHREAD = 0;
+     $IsDefault{'TSLICECURTHREAD'} = 1;
+ }
  
  ##-------------------##
  ## Message resources ##
***************
*** 382,388 ****
  $TPREVBUTTONIA = '[Thread Prev]',
      $IsDefault{'TPREVBUTTONIA'} = 1   unless $TPREVBUTTONIA;
  
! ## Next message in thread link
  unless ($TNEXTLINK) {
      $TNEXTLINK =<<'EndOfStr';
  <li>Next by thread:
--- 401,407 ----
  $TPREVBUTTONIA = '[Thread Prev]',
      $IsDefault{'TPREVBUTTONIA'} = 1   unless $TPREVBUTTONIA;
  
! ## Next message by thread link
  unless ($TNEXTLINK) {
      $TNEXTLINK =<<'EndOfStr';
  <li>Next by thread:
***************
*** 392,401 ****
      $IsDefault{'TNEXTLINK'} = 1;
  }
  
! ## Inactive next message in thread link
  $TNEXTLINKIA = '', $IsDefault{'TNEXTLINKIA'} = 1  unless $TNEXTLINKIA;
  
! ## Previous message in thread link
  unless ($TPREVLINK) {
      $TPREVLINK =<<'EndOfStr';
  <li>Prev by thread:
--- 411,420 ----
      $IsDefault{'TNEXTLINK'} = 1;
  }
  
! ## Inactive next message by thread link
  $TNEXTLINKIA = '', $IsDefault{'TNEXTLINKIA'} = 1  unless $TNEXTLINKIA;
  
! ## Previous message by thread link
  unless ($TPREVLINK) {
      $TPREVLINK =<<'EndOfStr';
  <li>Prev by thread:
***************
*** 405,412 ****
      $IsDefault{'TPREVLINK'} = 1;
  }
  
! ## Inactive previous message in thread link
  $TPREVLINKIA = '', $IsDefault{'TPREVLINKIA'} = 1  unless $TPREVLINKIA;
  
  ## Top links in message
  if (!$TOPLINKS) {
--- 424,503 ----
      $IsDefault{'TPREVLINK'} = 1;
  }
  
! ## Inactive previous message by thread link
  $TPREVLINKIA = '', $IsDefault{'TPREVLINKIA'} = 1  unless $TPREVLINKIA;
+ 
+ ## Next/previous thread buttons
+ $TNEXTTOPBUTTON = '[<a href="$MSG(TNEXTTOP)$">Next Thread</a>]',
+     $IsDefault{'TNEXTTOPBUTTON'} = 1  unless $TNEXTTOPBUTTON;
+ $TPREVTOPBUTTON = '[<a href="$MSG(TPREVTOP)$">Prev Thread</a>]',
+     $IsDefault{'TPREVTOPBUTTON'} = 1  unless $TPREVTOPBUTTON;
+ $TNEXTTOPBUTTONIA = '[Next Thread]',
+     $IsDefault{'TNEXTTOPBUTTONIA'} = 1        unless $TNEXTTOPBUTTONIA;
+ $TPREVTOPBUTTONIA = '[Prev Thread]',
+     $IsDefault{'TPREVTOPBUTTONIA'} = 1        unless $TPREVTOPBUTTONIA;
+ 
+ ## Next thread link
+ unless ($TNEXTTOPLINK) {
+     $TNEXTTOPLINK =<<'EndOfStr';
+ <li>Next thread:
+ <strong><a href="$MSG(TNEXTTOP)$">$SUBJECT(TNEXTTOP)$</a></strong>
+ </li>
+ EndOfStr
+     $IsDefault{'TNEXTTOPLINK'} = 1;
+ }
+ 
+ ## Inactive next thread link
+ $TNEXTTOPLINKIA = '', $IsDefault{'TNEXTTOPLINKIA'} = 1  unless 
$TNEXTTOPLINKIA;
+ 
+ ## Previous thread link
+ unless ($TPREVTOPLINK) {
+     $TPREVTOPLINK =<<'EndOfStr';
+ <li>Prev thread:
+ <strong><a href="$MSG(TPREVTOP)$">$SUBJECT(TPREVTOP)$</a></strong>
+ </li>
+ EndOfStr
+     $IsDefault{'TPREVTOPLINK'} = 1;
+ }
+ 
+ ## Inactive previous thread link
+ $TPREVTOPLINKIA = '', $IsDefault{'TPREVTOPLINKIA'} = 1  unless 
$TPREVTOPLINKIA;
+ 
+ ## Next/previous in thread buttons
+ $TNEXTINBUTTON = '[<a href="$MSG(TNEXTIN)$">Next In Thread</a>]',
+     $IsDefault{'TNEXTINBUTTON'} = 1   unless $TNEXTINBUTTON;
+ $TPREVINBUTTON = '[<a href="$MSG(TPREVIN)$">Prev In Thread</a>]',
+     $IsDefault{'TPREVINBUTTON'} = 1   unless $TPREVINBUTTON;
+ $TNEXTINBUTTONIA = '[Next In Thread]',
+     $IsDefault{'TNEXTINBUTTONIA'} = 1 unless $TNEXTINBUTTONIA;
+ $TPREVINBUTTONIA = '[Prev In Thread]',
+     $IsDefault{'TPREVINBUTTONIA'} = 1 unless $TPREVINBUTTONIA;
+ 
+ ## Next in thread link
+ unless ($TNEXTINLINK) {
+     $TNEXTINLINK =<<'EndOfStr';
+ <li>Next in thread:
+ <strong><a href="$MSG(TNEXTIN)$">$SUBJECT(TNEXTIN)$</a></strong>
+ </li>
+ EndOfStr
+     $IsDefault{'TNEXTINLINK'} = 1;
+ }
+ 
+ ## Inactive next in thread link
+ $TNEXTINLINKIA = '', $IsDefault{'TNEXTINLINKIA'} = 1  unless $TNEXTINLINKIA;
+ 
+ ## Previous in thread link
+ unless ($TPREVINLINK) {
+     $TPREVINLINK =<<'EndOfStr';
+ <li>Prev in thread:
+ <strong><a href="$MSG(TPREVIN)$">$SUBJECT(TPREVIN)$</a></strong>
+ </li>
+ EndOfStr
+     $IsDefault{'TPREVINLINK'} = 1;
+ }
+ 
+ ## Inactive previous in thread link
+ $TPREVINLINKIA = '', $IsDefault{'TPREVINLINKIA'} = 1  unless $TPREVINLINKIA;
  
  ## Top links in message
  if (!$TOPLINKS) {
diff -c -r MHonArc2.4.9/lib/mhinit.pl MHonArc2.4.9-p/lib/mhinit.pl
*** MHonArc2.4.9/lib/mhinit.pl  Sun Jun 10 16:11:25 2001
--- MHonArc2.4.9-p/lib/mhinit.pl        Sun Jun 24 18:26:35 2001
***************
*** 486,491 ****
--- 486,495 ----
  $SubReplyRxp = $ENV{'M2H_SUBJECTREPLYRXP'} ||
               q/^\s*(re|sv|fwd|fw)[\[\]\d]*[:>-]+\s*/;
  
+ ##    Regex preventing subject threading.
+ $SubNoThreadRxp = $ENV{'M2H_SUBJECTNOTHREADRXP'} ||
+              q/(?!)/;
+ 
  ##    Code for stripping subjects
  $SubStripCode = $ENV{'M2H_SUBJECTSTRIPCODE'} || "";
  
***************
*** 525,535 ****
--- 529,542 ----
  $THEAD        = '';   # Thread index header (and list start)
  $TFOOT        = '';   # Thread index footer (and list end)
  $TSINGLETXT   = '';   # Single/lone thread entry template
+ $TSINGLETXTCUR        = '';   # Single/lone thread entry template for cur msg
  $TTOPBEG      = '';   # Top of a thread begin template
+ $TTOPBEGCUR   = '';   # Top of a threat begin template for cur msg
  $TTOPEND      = '';   # Top of a thread end template
  $TSUBLISTBEG  = '';   # Sub-thread list open
  $TSUBLISTEND  = '';   # Sub-thread list close
  $TLITXT       = '';   # Thread list item text
+ $TLITXTCUR    = '';   # Thread list item text for cur msg
  $TLIEND       = '';   # Thread list item end
  $TLINONE      = '';   # List item for missing message in thread
  $TLINONEEND   = '';   # List item end for missing message in thread
***************
*** 542,547 ****
--- 549,555 ----
  
  $TSLICEBEG    = '';   # Start of thread slice
  $TSLICEEND    = '';   # End of thread slice
+ $TSLICECURTHREAD= ''; # Thread slice does not contain current thread
  
  $MSGFOOT      = '';   # Message footer
  $MSGHEAD      = '';   # Message header
***************
*** 575,580 ****
--- 583,606 ----
  $TNEXTLINKIA  = '';   # Thread Next inactive link template
  $TPREVLINK    = '';   # Thread Previous link template
  $TPREVLINKIA  = '';   # Thread Previous inactive link template
+ 
+ $TNEXTTOPBUTTON       = '';   # Next Thread button template
+ $TNEXTTOPBUTTONIA = '';       # Next Thread inactive button template
+ $TPREVTOPBUTTON       = '';   # Previous Thread button template
+ $TPREVTOPBUTTONIA = '';       # Previous Thread inactive button template
+ $TNEXTTOPLINK = '';   # Next Thread link template
+ $TNEXTTOPLINKIA       = '';   # Next Thread inactive link template
+ $TPREVTOPLINK = '';   # Previous Thread link template
+ $TPREVTOPLINKIA       = '';   # Previous Thread inactive link template
+ 
+ $TNEXTINBUTTON        = '';   # Next In Thread button template
+ $TNEXTINBUTTONIA = '';        # Next In Thread inactive button template
+ $TPREVINBUTTON        = '';   # Previous In Thread button template
+ $TPREVINBUTTONIA = '';        # Previous In Thread inactive button template
+ $TNEXTINLINK  = '';   # Next In Thread link template
+ $TNEXTINLINKIA        = '';   # Next In Thread inactive link template
+ $TPREVINLINK  = '';   # Previous In Thread link template
+ $TPREVINLINKIA        = '';   # Previous In Thread inactive link template
  
  $IDXPGBEG     = '';   # Beginning of main index page
  $IDXPGEND     = '';   # Ending of main index page
diff -c -r MHonArc2.4.9/lib/mhopt.pl MHonArc2.4.9-p/lib/mhopt.pl
*** MHonArc2.4.9/lib/mhopt.pl   Tue Apr 10 19:46:28 2001
--- MHonArc2.4.9-p/lib/mhopt.pl Sun Jun 24 10:03:18 2001
***************
*** 463,468 ****
--- 463,469 ----
  
      $AddressModify = $opt{'addressmodifycode'}  if $opt{'addressmodifycode'};
      $SubArtRxp     = $opt{'subjectarticlerxp'}  if $opt{'subjectarticlerxp'};
+     $SubNoThreadRxp= $opt{'subjectnothreadrxp'} if $opt{'subjectnothreadrxp'};
      $SubReplyRxp   = $opt{'subjectreplyrxp'}    if $opt{'subjectreplyrxp'};
      $SubStripCode  = $opt{'subjectstripcode'}   if $opt{'subjectstripcode'};
      $MsgExcFilter  = $opt{'msgexcfilter'}    if defined($opt{'msgexcfilter'});
***************
*** 704,709 ****
--- 705,711 ----
      }
      delete $IndexNum{''};
      $TLITXT = '<LI>' . $TLITXT  unless ($TLITXT) && ($TLITXT =~ /<li>/i);
+     $TLITXTCUR = '<LI>' . $TLITXTCUR unless ($TLITXTCUR) && ($TLITXTCUR =~ 
/<li>/i);
      $THEAD .= "<UL>\n"   unless ($THEAD) && ($THEAD =~ m%<ul>\s*$%i);
      $TFOOT  = "</UL>\n"  unless ($TFOOT) && ($TFOOT =~ m%^\s*</ul>%i);
  }
diff -c -r MHonArc2.4.9/lib/mhrcfile.pl MHonArc2.4.9-p/lib/mhrcfile.pl
*** MHonArc2.4.9/lib/mhrcfile.pl        Sun Jun 10 16:11:25 2001
--- MHonArc2.4.9-p/lib/mhrcfile.pl      Sun Jun 24 10:03:37 2001
***************
*** 45,50 ****
--- 45,51 ----
      } else {
        $pathhead = '';
      }
+     $MainPathhead = $pathhead if ! defined $MainPathhead;
  
      print STDOUT "Reading resource file: $file ...\n"  unless $QUIET;
      while (defined($line = <$handle>)) {
***************
*** 672,677 ****
--- 673,683 ----
        if ($elem eq "notreverse") {            # Thread sort in normal order
            $TREVERSE = 0; last FMTSW;
        }
+       if ($elem eq "notslicecurthread" ||
+           $elem eq "tnoslicecurthread" ||
+           $elem eq "tslicenocurthread") {     # Thread slice isn't cur thread
+           $TSLICECURTHREAD = 0; last FMTSW;
+       }
        if ($elem eq 'notsubsort' ||
            $elem eq "tnosubsort") {            # No subject order for threads
            $TSUBSORT = 0;
***************
*** 767,772 ****
--- 773,784 ----
            }
            last FMTSW;
        }
+       if ($elem eq "subjectnothreadrxp") {    # Regex to prevent subj thread
+           if ($line = &get_elem_last_line($handle, $elem)) {
+               $SubNoThreadRxp = $line;
+           }
+           last FMTSW;
+       }
        if ($elem eq "subjectreplyrxp") {       # Regex for reply text
            if ($line = &get_elem_last_line($handle, $elem)) {
                $SubReplyRxp = $line;
***************
*** 881,886 ****
--- 893,902 ----
            $TLITXT = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
        }
+       if ($elem eq "tlitxtcur") {             # Thread idx list item, cur msg
+           $TLITXTCUR = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
        if ($elem eq "tliend") {                # Thread idx list item end
            $TLIEND = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
***************
*** 898,903 ****
--- 914,923 ----
            $TSLICEBEG = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
        }
+       if ($elem eq "tslicecurthread") {       # Thread slice is cur thread
+           $TSLICECURTHREAD = 1;
+           last FMTSW;
+       }
        if ($elem eq "tsliceend") {             # End of thread slice
            $TSLICEEND = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
***************
*** 930,939 ****
--- 950,967 ----
            $TSINGLETXT = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
        }
+       if ($elem eq "tsingletxtcur") {         # Markup for single msg, cur
+           $TSINGLETXTCUR = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
        if ($elem eq "ttopbegin") {             # Begin for top of a thread
            $TTOPBEG = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
        }
+       if ($elem eq "ttopbegincur") {          # Begin for top of a thread cur
+           $TTOPBEGCUR = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
        if ($elem eq "ttopend") {               # End for a thread
            $TTOPEND = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
***************
*** 969,974 ****
--- 997,1034 ----
            $TNEXTPGLINKIA = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
        }
+       if ($elem eq "tnextinbutton") {         # Next In Thread button link
+           $TNEXTINBUTTON = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tnextinbuttonia") {
+           $TNEXTINBUTTONIA = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tnextinlink") {           # Next In Thread link
+           $TNEXTINLINK = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tnextinlinkia") {
+           $TNEXTINLINKIA = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tnexttopbutton") {        # Next Thread button link
+           $TNEXTTOPBUTTON = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tnexttopbuttonia") {
+           $TNEXTTOPBUTTONIA = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tnexttoplink") {          # Next Thread link
+           $TNEXTTOPLINK = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tnexttoplinkia") {
+           $TNEXTTOPLINKIA = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
        if ($elem eq "tprevbutton") {           # Thread Prev button link
            $TPREVBUTTON = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
***************
*** 991,996 ****
--- 1051,1088 ----
        }
        if ($elem eq "tprevpglinkia") {
            $TPREVPGLINKIA = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tprevinbutton") {         # Prev In Thread button link
+           $TPREVINBUTTON = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tprevinbuttonia") {
+           $TPREVINBUTTONIA = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tprevinlink") {           # Prev In Thread link in msg
+           $TPREVINLINK = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tprevinlinkia") {
+           $TPREVINLINKIA = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tprevtopbutton") {        # Prev Thread button link
+           $TPREVTOPBUTTON = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tprevtopbuttonia") {
+           $TPREVTOPBUTTONIA = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tprevtoplink") {          # Prev Thread link in message
+           $TPREVTOPLINK = &get_elem_content($handle, $elem, $chop);
+           last FMTSW;
+       }
+       if ($elem eq "tprevtoplinkia") {
+           $TPREVTOPLINKIA = &get_elem_content($handle, $elem, $chop);
            last FMTSW;
        }
        if ($elem eq "treverse") {              # Reverse order of threads
diff -c -r MHonArc2.4.9/lib/mhrcvars.pl MHonArc2.4.9-p/lib/mhrcvars.pl
*** MHonArc2.4.9/lib/mhrcvars.pl        Tue Apr 10 19:46:28 2001
--- MHonArc2.4.9-p/lib/mhrcvars.pl      Sat Jun 23 09:51:03 2001
***************
*** 115,122 ****
            $isfirst    = ($Index2MLoc{$index} == 0);
            $islast     = ($Index2MLoc{$index} == $#MListOrder);
        }
!       $tisfirst       = ($Index2TLoc{$index} == 0);
!       $tislast        = ($Index2TLoc{$index} == $#TListOrder);
      }
  
      ##        Do variable replacement
--- 115,127 ----
            $isfirst    = ($Index2MLoc{$index} == 0);
            $islast     = ($Index2MLoc{$index} == $#MListOrder);
        }
!       if ($TREVERSE) {
!           $tisfirst   = ($Index2TLoc{$index} == $#TListOrder);
!           $tislast    = ($Index2TLoc{$index} == 0);
!       } else {
!           $tisfirst   = ($Index2TLoc{$index} == 0);
!           $tislast    = ($Index2TLoc{$index} == $#TListOrder);
!       }
      }
  
      ##        Do variable replacement
***************
*** 283,288 ****
--- 288,309 ----
                if ($arg eq 'TPREV') {
                    $tmp = (!$tisfirst) ? $TPREVBUTTON : $TPREVBUTTONIA;
                    last SW; }
+               if ($arg eq 'TNEXTTOP') {
+                   $tmp = ((compute_msg_pos($index, '', $arg, 1))[2] >= 0);
+                   $tmp = ($tmp) ? $TNEXTTOPBUTTON : $TNEXTTOPBUTTONIA;
+                   last SW; }
+               if ($arg eq 'TPREVTOP') {
+                   $tmp = ((compute_msg_pos($index, '', $arg, 1))[2] >= 0);
+                   $tmp = ($tmp) ? $TPREVTOPBUTTON : $TPREVTOPBUTTONIA;
+                   last SW; }
+               if ($arg eq 'TNEXTIN') {
+                   $tmp = ((compute_msg_pos($index, '', $arg, 1))[2] >= 0);
+                   $tmp = ($tmp) ? $TNEXTINBUTTON : $TNEXTINBUTTONIA;
+                   last SW; }
+               if ($arg eq 'TPREVIN') {
+                   $tmp = ((compute_msg_pos($index, '', $arg, 1))[2] >= 0);
+                   $tmp = ($tmp) ? $TPREVINBUTTON : $TPREVINBUTTONIA;
+                   last SW; }
            }
            last REPLACESW;
        }
***************
*** 301,313 ****
                if ($arg eq 'TPREV') {
                    $tmp = (!$tisfirst) ? $TPREVLINK : $TPREVLINKIA;
                    last SW; }
            }
            last REPLACESW;
        }
  
        if ($var eq 'TSLICE') {
!           $tmp = &make_thread_slice($index, $TSliceNBefore, $TSliceNAfter)
!               if ($TSliceNBefore != 0 || $TSliceNAfter != 0);
            last REPLACESW;
        }
  
--- 322,354 ----
                if ($arg eq 'TPREV') {
                    $tmp = (!$tisfirst) ? $TPREVLINK : $TPREVLINKIA;
                    last SW; }
+               if ($arg eq 'TNEXTTOP') {
+                   $tmp = ((compute_msg_pos($index, '', $arg, 1))[2] >= 0);
+                   $tmp = ($tmp) ? $TNEXTTOPLINK : $TNEXTTOPLINKIA;
+                   last SW; }
+               if ($arg eq 'TPREVTOP') {
+                   $tmp = ((compute_msg_pos($index, '', $arg, 1))[2] >= 0);
+                   $tmp = ($tmp) ? $TPREVTOPLINK : $TPREVTOPLINKIA;
+                   last SW; }
+               if ($arg eq 'TNEXTIN') {
+                   $tmp = ((compute_msg_pos($index, '', $arg, 1))[2] >= 0);
+                   $tmp = ($tmp) ? $TNEXTINLINK : $TNEXTINLINKIA;
+                   last SW; }
+               if ($arg eq 'TPREVIN') {
+                   $tmp = ((compute_msg_pos($index, '', $arg, 1))[2] >= 0);
+                   $tmp = ($tmp) ? $TPREVINLINK : $TPREVINLINKIA;
+                   last SW; }
            }
            last REPLACESW;
        }
  
        if ($var eq 'TSLICE') {
!           my(@args) = split(/;/, $arg);
!           my($thread_only) = (@args > 2 ? $args[2] : $TSLICECURTHREAD);
!           my($nafter) = (@args > 1 ? $args[1] : $TSliceNAfter);
!           my($nbefore) = (@args > 0 ? $args[0] : $TSliceNBefore);
!           $tmp = &make_thread_slice($index, $nbefore, $nafter, $thread_only)
!               if ($nbefore != 0 || $nafter != 0);
            last REPLACESW;
        }
  
***************
*** 594,604 ****
  }
  
  
##---------------------------------------------------------------------------##
  ##    compute_msg_pos(): Get message location data.
  ##
  sub compute_msg_pos {
      my($idx, $var, $arg, $usethread) = @_;
!     my($ofs, $pos, $aref, $href, $key);
      my $opt  = undef;
      my $flip = 0;
  
--- 635,667 ----
  }
  
  
##---------------------------------------------------------------------------##
+ ##    compute_thread_nav(): Get index of next/previous thread.
+ ##    Arguments: $pos         Position of current message in thread index.
+ ##               $arg         NEXT, PREV, TOP, or END.
+ ##
+ sub compute_thread_nav {
+     my($pos, $arg) = @_;
+     return -1 if !defined($pos) || $pos < 0 || $pos >= $#TListOrder;
+     
+     if ($arg eq 'TOP') {
+       while ($ThreadLevel{$TListOrder[$pos]} > 0) {
+           $pos--;
+       }
+     } elsif ($arg eq 'END') {
+       while ($pos < $#TListOrder && $ThreadLevel{$TListOrder[$pos+1]} > 0) {
+           $pos++;
+       }
+     }
+     
+     return ($pos >= 0 && $pos <= $#TListOrder) ? $pos : -1;
+ }
+ 
+ 
##---------------------------------------------------------------------------##
  ##    compute_msg_pos(): Get message location data.
  ##
  sub compute_msg_pos {
      my($idx, $var, $arg, $usethread) = @_;
!     my($pos, $aref, $href, $key);
      my $opt  = undef;
      my $flip = 0;
  
***************
*** 606,611 ****
--- 669,676 ----
      if (($arg =~ s/^T//) || $usethread) {
        $aref = \(_at_)TListOrder;
        $href = \%Index2TLoc;
+       $flip = $TREVERSE;
+       $usethread = 1;
      } else {
        $aref = \(_at_)MListOrder;
        $href = \%Index2MLoc;
***************
*** 615,671 ****
      ## Extract out optional data
      ($arg, $opt) = split(/;/, $arg);
  
      SW: {
!       $ofs =  0, last SW
            if $arg eq "" or $arg eq 'CUR';
!       $ofs = ($flip ? 1 : -1), last SW
!           if $arg eq 'PREV';
!       $ofs = ($flip ? -1 : 1), last SW
!           if $arg eq 'NEXT';
!       $ofs = ($flip ? -$arg : $arg), last SW
!           if $arg =~ /^-?\d+$/;
! 
!       if ($arg eq 'FIRST') {
!           $pos = $flip ? $#$aref : 0;
!           undef $ofs;
            last SW;
        }
!       if ($arg eq 'LAST') {
!           $pos = $flip ? 0 : $#$aref;
!           undef $ofs;
            last SW;
        }
!       if ($arg eq 'PARENT') {
!           undef $ofs;
            my $level = $ThreadLevel{$idx};
-           $pos = $Index2TLoc{$idx};
            last SW  if ($level <= 0);
            for (--$pos; $pos >= 0; --$pos) {
                last  if $ThreadLevel{$TListOrder[$pos]} < $level;
            }
            last SW;
        }
!       if ($arg eq 'TOP') {
!           undef $ofs;
!           $pos = $Index2TLoc{$idx};
!           for (; $pos >= 0; --$pos) {
!               last  if $ThreadLevel{$TListOrder[$pos]} <= 0;
!           }
            last SW;
        }
!       if ($arg eq 'END') {
!           undef $ofs;
!           $pos = $Index2TLoc{$idx};
!           for (; $pos < $#TListOrder; ++$pos) {
!               last  if $ThreadLevel{$TListOrder[$pos+1]} <= 0;
!           }
            last SW;
        }
        warn qq/Warning: $var: Unrecognized variable argument: "$arg"\n/;
-       $ofs = 0;
      }
!     $pos = $href->{$idx} + $ofs  if defined($ofs);
!     if (($pos > $#$aref) || ($pos < 0)) {
        $pos = -1;
        $key = undef;
      } else {
--- 680,769 ----
      ## Extract out optional data
      ($arg, $opt) = split(/;/, $arg);
  
+     ## Initialize with current position
+     $pos = $href->{$idx};
+ 
      SW: {
!       last SW
            if $arg eq "" or $arg eq 'CUR';
!       $pos += ($flip ? 1 : -1), last SW
!           if $arg eq 'PREV' && (!$usethread || !$flip);
!       $pos += ($flip ? -1 : 1), last SW
!           if $arg eq 'NEXT' && (!$usethread || !$flip);
!       $pos += ($flip ? -$arg : $arg), last SW
!           if $arg =~ /^-?\d+$/ && (!$usethread || !$flip);
! 
!       $pos = ($flip ? $#$aref : 0), last SW
!           if $arg eq 'FIRST';
!       $pos = ($flip ? 0 : $#$aref), last SW
!           if $arg eq 'LAST';
! 
!       if ($arg eq 'NEXT' && $usethread && $flip) {
!           # have to treat specially if last message in thread
!           if ($pos == $#$aref || $ThreadLevel{$aref->[$pos + 1]} == 0) {
!               $pos = compute_thread_nav($pos, 'TOP');
!               $pos = compute_thread_nav($pos - 1, 'TOP') if $pos >= 0;
!           } else {
!               $pos++;
!           }
            last SW;
        }
!       if ($arg eq 'PREV' && $usethread && $flip) {
!           # have to treat specially if first message in thread
!           if ($pos == 0 || $ThreadLevel{$aref->[$pos]} == 0) {
!               $pos = compute_thread_nav($pos, 'END');
!               $pos = compute_thread_nav($pos + 1, 'END') if $pos >= 0;
!           } else {
!               $pos--;
!           }
            last SW;
        }
! 
!       if ($arg eq 'PARENT' && $usethread) {
            my $level = $ThreadLevel{$idx};
            last SW  if ($level <= 0);
            for (--$pos; $pos >= 0; --$pos) {
                last  if $ThreadLevel{$TListOrder[$pos]} < $level;
            }
            last SW;
        }
!       if ($arg eq 'TOP' && $usethread) {
!           $pos = compute_thread_nav($pos, 'TOP');
            last SW;
        }
!       if ($arg eq 'END' && $usethread) {
!           $pos = compute_thread_nav($pos, 'END');
!           last SW;
!       }
!       
!       if ((($arg eq 'PREVTOP' && !$flip) || ($arg eq 'NEXTTOP' && $flip))
!           && $usethread) {
!           $pos = compute_thread_nav($pos, 'TOP');
!           $pos = compute_thread_nav($pos - 1, 'TOP') if $pos >= 0;
!           last SW;
!       }
!       if ((($arg eq 'NEXTTOP' && !$flip) || ($arg eq 'PREVTOP' && $flip))
!           && $usethread) {
!           $pos = compute_thread_nav($pos, 'END');
!           ++$pos if $pos >= 0;
!           last SW;
!       }
! 
!       if ($arg eq 'PREVIN' && $usethread) {
!           $pos = ($ThreadLevel{$idx} == 0 ? -1 : $pos - 1);
!           last SW;
!       }
!       if ($arg eq 'NEXTIN' && $usethread) {
!           ++$pos;
!           $pos = -1  if $pos <= $#TListOrder
!                               && $ThreadLevel{$TListOrder[$pos]} == 0;
            last SW;
        }
+       
        warn qq/Warning: $var: Unrecognized variable argument: "$arg"\n/;
      }
!     
!     if (!defined($pos) || ($pos > $#$aref) || ($pos < 0)) {
        $pos = -1;
        $key = undef;
      } else {
diff -c -r MHonArc2.4.9/lib/mhthread.pl MHonArc2.4.9-p/lib/mhthread.pl
*** MHonArc2.4.9/lib/mhthread.pl        Fri Jun 25 20:23:32 1999
--- MHonArc2.4.9-p/lib/mhthread.pl      Sun Jun 24 10:05:39 2001
***************
*** 226,231 ****
--- 226,232 ----
            $stripsub{$index} = $tmp;
            $FirstSub2Index{$tmp} = $index
                unless defined($FirstSub2Index{$tmp}) ||
+                      ($tmp =~ /$SubNoThreadRxp/io) ||
                       (defined($Refs{$index}) &&
                        grep($MsgId{$_}, split(/$X/o, $Refs{$index})));
        }
***************
*** 434,444 ****
  ##        $refindex   : Reference message index that slice is based
  ##        $bcnt       : Number of messages before $refindex to list
  ##        $acnt       : Number of messages after $refindex to list
  ##
  ##    Returns string containing thread slice text.
  ##
  sub make_thread_slice {
!     local($refindex, $bcnt, $acnt) = @_;
      local($slicetxt) = "";
  
      local($pos)   = $Index2TLoc{$refindex};
--- 435,446 ----
  ##        $refindex   : Reference message index that slice is based
  ##        $bcnt       : Number of messages before $refindex to list
  ##        $acnt       : Number of messages after $refindex to list
+ ##        $threadonly : Limit to the top-level thread containing $refindex
  ##
  ##    Returns string containing thread slice text.
  ##
  sub make_thread_slice {
!     local($refindex, $bcnt, $acnt, $threadonly) = @_;
      local($slicetxt) = "";
  
      local($pos)   = $Index2TLoc{$refindex};
***************
*** 446,456 ****
      local($end)   = $pos + $acnt;
          $start  = 0             if $start < 0;
          $end    = $#TListOrder  if $end > $#TListOrder;
-     local(@a)   = @TListOrder[$start..$end];
  
      local($lastlevel) = $ThreadLevel{$a[0]};
      local($level)     = 0;    ## !!!Used in print_thread!!!
      local(%Printed);          ## !!!Used in print_thread!!!
      local($tmpl, $index, $tlevel, $iscont, $i);
  
      ($tmpl = $TSLICEBEG) =~ s/$VarExp/&replace_li_var($1,'')/geo;
--- 448,470 ----
      local($end)   = $pos + $acnt;
          $start  = 0             if $start < 0;
          $end    = $#TListOrder  if $end > $#TListOrder;
  
+     if ($threadonly) {
+       my($s, $e) = ($start, $end);
+       for ($start = $pos; $start > $s; $start--) {
+           last if !$ThreadLevel{$TListOrder[$start]};
+       }
+       for ($end = $pos; $end < $e; $end++) {
+           last if !$ThreadLevel{$TListOrder[$end+1]};
+       }
+     }
+ 
+     local(@a)   = @TListOrder[$start..$end];
+     
      local($lastlevel) = $ThreadLevel{$a[0]};
      local($level)     = 0;    ## !!!Used in print_thread!!!
      local(%Printed);          ## !!!Used in print_thread!!!
+     local($curMsgIdx) = $refindex; ## !!!Used in print_thread!!!
      local($tmpl, $index, $tlevel, $iscont, $i);
  
      ($tmpl = $TSLICEBEG) =~ s/$VarExp/&replace_li_var($1,'')/geo;
***************
*** 521,527 ****
  
  ##---------------------------------------------------------------------------
  ##    Routine to generate text representing a thread.
! ##    Uses %Printed and $level defined by caller.
  ##
  sub make_thread {
      local($idx, $top) = @_;
--- 535,541 ----
  
  ##---------------------------------------------------------------------------
  ##    Routine to generate text representing a thread.
! ##    Uses %Printed, $level, and $curMsgIdx defined by caller.
  ##
  sub make_thread {
      local($idx, $top) = @_;
***************
*** 550,558 ****
      $single  = ($top && !$hvnirepls);
  
      if ($attop) {
!       $ret .= &expand_thread_var($idx, *TTOPBEG);
      } elsif ($single) {
!       $ret .= &expand_thread_var($idx, *TSINGLETXT);
      } else {
        ## Check for missing messages
        if ($DoMissingMsgs) {
--- 564,580 ----
      $single  = ($top && !$hvnirepls);
  
      if ($attop) {
!         if ($idx eq $curMsgIdx) {
!           $ret .= &expand_thread_var($idx, *TTOPBEGCUR);
!       } else {
!           $ret .= &expand_thread_var($idx, *TTOPBEG);
!       }
      } elsif ($single) {
!         if ($idx eq $curMsgIdx) {
!           $ret .= &expand_thread_var($idx, *TSINGLETXTCUR);
!         } else {
!           $ret .= &expand_thread_var($idx, *TSINGLETXT);
!       }
      } else {
        ## Check for missing messages
        if ($DoMissingMsgs) {
***************
*** 563,569 ****
                    if $level <= $TLEVELS;
            }
        }
!       $ret .= &expand_thread_var($idx, *TLITXT);
      }
  
      ## Increment level count if their are replies
--- 585,595 ----
                    if $level <= $TLEVELS;
            }
        }
!       if ($idx eq $curMsgIdx) {
!           $ret .= &expand_thread_var($idx, *TLITXTCUR);
!       } else {
!           $ret .= &expand_thread_var($idx, *TLITXT);
!       }
      }
  
      ## Increment level count if their are replies
diff -c -r MHonArc2.4.9/lib/mhutil.pl MHonArc2.4.9-p/lib/mhutil.pl
*** MHonArc2.4.9/lib/mhutil.pl  Sun Feb 13 03:49:51 2000
--- MHonArc2.4.9-p/lib/mhutil.pl        Sun Jun 24 09:39:56 2001
***************
*** 129,135 ****
            $sub{$idx} = $sub;
        }
        if ($revsort) {
!           return sort { ($sub{$b} cmp $sub{$a}) ||
                          (get_time_from_index($b) <=> get_time_from_index($a))
                        } keys %Subject;
        } else {
--- 129,135 ----
            $sub{$idx} = $sub;
        }
        if ($revsort) {
!           return sort { ($sub{$a} cmp $sub{$b}) ||
                          (get_time_from_index($b) <=> get_time_from_index($a))
                        } keys %Subject;
        } else {
***************
*** 150,156 ****
            $from{$idx} = $from;
        }
        if ($revsort) {
!           return sort { ($from{$b} cmp $from{$a}) ||
                          (get_time_from_index($b) <=> get_time_from_index($a))
                        } keys %Subject;
        } else {
--- 150,156 ----
            $from{$idx} = $from;
        }
        if ($revsort) {
!           return sort { ($from{$a} cmp $from{$b}) ||
                          (get_time_from_index($b) <=> get_time_from_index($a))
                        } keys %Subject;
        } else {
<Prev in Thread] Current Thread [Next in Thread>