]> granicus.if.org Git - mutt/commitdiff
updated messages-in-thread (%e) patch from Markus Holmberg.
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 10 May 2000 17:16:43 +0000 (17:16 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 10 May 2000 17:16:43 +0000 (17:16 +0000)
hdrline.c
thread.c

index 50e635a4a0c1de2347b05e9a17bdd36b9c512f81..e53ceb7b20c89e3be43e0787212f93a8b020dd01 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -202,6 +202,8 @@ int mutt_user_is_recipient (HEADER *h)
  * %C = current message number
  * %d = date and time of message using $date_format and sender's timezone
  * %D = date and time of message using $date_format and local timezone
+ * %e = current message number in thread
+ * %E = number of messages in current thread
  * %f = entire from line
  * %F = like %n, unless from self
  * %i = message-id
index 37929a368bf0ff46266973aba417b5e391198c3d..f5ef0a8a81103e0bac3a481dfa1f1e45dbf8c59d 100644 (file)
--- a/thread.c
+++ b/thread.c
@@ -895,8 +895,8 @@ int mutt_messages_in_thread (HEADER *cur)
  
   if ((Sort & SORT_MASK) != SORT_THREADS)
   {
-    mutt_error _("Threading is not enabled.");
-    return (-1);
+    /* mutt_error _("Threading is not enabled."); */
+    return (1);
   }
 
   /* find top parent */
@@ -904,7 +904,7 @@ int mutt_messages_in_thread (HEADER *cur)
     cur = cur->parent;
   top = cur;
  
-  /* return if there are no children at all */
+  /* return if there are no children */
   if ((cur = cur->child) == NULL)
     return n;
 
@@ -937,8 +937,8 @@ int mutt_msgno_in_thread (HEADER *cur)
 
   if ((Sort & SORT_MASK) != SORT_THREADS)
   { 
-    mutt_error _("Threading is not enabled.");
-    return (-1);
+    /* mutt_error _("Threading is not enabled."); */
+    return (0);
   } 
 
   /* save target */
@@ -953,9 +953,8 @@ int mutt_msgno_in_thread (HEADER *cur)
   if (top == target)
     return n;
 
-  /* return if there are no children at all */
-  if ((cur = cur->child) == NULL)
-    return n;
+  /* step into first child */
+  cur = cur->child;
 
   FOREVER
   {
@@ -969,14 +968,7 @@ int mutt_msgno_in_thread (HEADER *cur)
     else 
     {
       while (!cur->next) 
-      {
         cur = cur->parent;
-        if (cur == top) 
-       {
-          mutt_error _("Target message not found while counting messages in thread.");
-          return (-1);
-        }
-      }
       cur = cur->next;
     } 
   }