Subject: Re: bug#37655: 27.0.50; reversing `gnus-thread-sort-by-most-recent-date' does not work properly

From: Eric Abrahamsen <[email-masked]>
Date: Wed, 09 Oct 2019 11:55:35 -0700

Hong Xu <[email-masked]> writes:

> Reversing `gnus-thread-sort-by-most-recent-date' does not seem to work properly.
>
> To reproduce:
>
> Download the test mbox file from here: https://lists.gnu.org/archive/mbox/bug-gnu-emacs/2000-10 and save it as 2000-10.mbox.
>
> Start Emacs with "-Q", and evaluate the following:
>
> 	;; Latest at bottom
> 	(setq gnus-thread-sort-functions
> 	      '((not gnus-thread-sort-by-most-recent-date)))
>
> 	(setq gnus-summary-line-format "%U%R%z %(%&user-date;  %-15,15f  %B %s%)\n")
>
> `M-x gnus', followed by `G f /path/to/2000-10.mbox'. There is only one topic. Type `C-u Enter'.
>
> The summary buffer is supposed to sort the messages in reversed most recent date order in each thread, but a lot of non-compliance can be observed. For instance:
>
>     Oct 02 2000  [email-masked]  >  (no subject)
>     Oct 12 2000  fujyama yuu        \->
>     Oct 05 2000  [email-masked]   Repost PLEASE HELP or reply!!! please  :)
>     Oct 05 2000  Stefan Reichör    Docstring for kill-line not complete
>
>
> The ``(no subject)'' thread's latest mail is on Oct 12, but ``Docstring for kill-line not complete'' on Oct 05 is positioned after that.

I can reproduce this, but oddly it only seems to have gone wrong for
that one thread -- all the other threads in the mailbox seem to be
sorted correctly. I also note that the Summary buffer displays the date
of both messages in the thread as one day earlier than the Date header
in the message itself. So I wonder if there's just something weird about
one or both of the messages that's causing Gnus to handle the date
incorrectly.

When I have a bit more time I'll try to figure out what date Gnus is
trying to use for that thread.

Eric