From: Thomas Roessler Date: Wed, 10 May 2000 17:16:43 +0000 (+0000) Subject: updated messages-in-thread (%e) patch from Markus Holmberg. X-Git-Tag: mutt-1-3-1-rel~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8da7301793a7928212de8a76c16769e85a42b23;p=mutt updated messages-in-thread (%e) patch from Markus Holmberg. --- diff --git a/hdrline.c b/hdrline.c index 50e635a4..e53ceb7b 100644 --- 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 diff --git a/thread.c b/thread.c index 37929a36..f5ef0a8a 100644 --- 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; } }