The attached patch should fix this.

Thanks for reporting.

On 2001-09-02 18:45:39 -0400, David T-G wrote:
>Date: Sun, 2 Sep 2001 18:45:39 -0400
>From: David T-G <[EMAIL PROTECTED]>
>To: Mutt Users' List <[EMAIL PROTECTED]>
>Subject: why "no visible messages"?
>User-Agent: Mutt/1.3.22.1i
>
>Hi, all --
>
>So I'm trying out 1.3.22.1 and, in particular, trying to make it bomb the
>same way that 1.2.5 did, and it doesn't, but it gives an interesting
>message.
>
>If I have a mailbox (my current test candidate is mbox =F.mutt at
>just shy of 8k messages) where I've [automatically] pushed <esc>-V to
>collapse all threads and I then set sort to unsorted, go to a message
>that is not a thread head (usually the last message in the box, or '*'),
>and then reset sort to threads/date, my index is blank.  Hokay, I figure,
>I can handle that; mutt is pointing to a message that it can't really
>see.
>
>Under 1.2.5, if I try to move up or down, mutt bombs.  Very ungraceful.
>
>Under 1.3.22.1, if I try to move up or down, I get "no visible messages"
>in my status line at the bottom of the screen.  Now, that seems strange...
>There aren't *no* visible messages, since I haven't applied any limit,
>and I'd imagine that I'd move to the next visible message in the relevant
>direction from the thread containing the message that I grabbed in
>unsorted mode.
>
>Am I confused, or did I discover some unexpected (or at least undesirable)
>behavior?
>
>
>TIA & HAND
>
>:-D
>-- 
>David T-G                      * It's easier to fight for one's principles
>(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
>(work) [EMAIL PROTECTED]
>http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
>



-- 
Thomas Roessler                        http://log.does-not-exist.org/


Index: curs_main.c
===================================================================
RCS file: /home/roessler/cvsroot/mutt/curs_main.c,v
retrieving revision 2.64
diff -u -r2.64 curs_main.c
--- curs_main.c 2001/08/30 08:20:45     2.64
+++ curs_main.c 2001/09/03 13:58:32
@@ -363,10 +363,12 @@
 static void resort_index (MUTTMENU *menu)
 {
   int i;
-  const HEADER *current = CURHDR;
+  HEADER *current = CURHDR;
 
+  menu->current = -1;
   mutt_sort_headers (Context, 0);
   /* Restore the current message */
+
   for (i = 0; i < Context->vcount; i++)
   {
     if (Context->hdrs[Context->v2r[i]] == current)
@@ -375,6 +377,13 @@
       break;
     }
   }
+  
+  if ((Sort & SORT_MASK) == SORT_THREADS && menu->current < 0)
+    menu->current = mutt_parent_message (Context, current);
+  
+  if (menu->current < 0)
+    menu->current = ci_first_message ();
+  
   menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
 }
 
Index: thread.c
===================================================================
RCS file: /home/roessler/cvsroot/mutt/thread.c,v
retrieving revision 2.16
diff -u -r2.16 thread.c
--- thread.c    2001/07/26 10:14:36     2.16
+++ thread.c    2001/09/03 13:56:56
@@ -756,7 +756,7 @@
   {
     while ((hdr = hdr->parent))
     {
-      if (!ctx->pattern || hdr->limited)
+      if (hdr->virtual >= 0 && hdr->collapsed && (!ctx->pattern || hdr->limited))
        return (hdr->virtual);
     }
     mutt_error _("Parent message is not visible in limited view");

PGP signature

Reply via email to