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

From: Hong Xu <[email-masked]>
Date: Mon, 7 Oct 2019 22:02:04 -0700

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.

In GNU Emacs 27.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
  of 2019-10-07 built on home
Repository revision: 32a67a5cfbfb92a9f76a5caf1c4b84beffcb1d9e
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
  'configure --with-modules --with-xwidgets
  --prefix=/home/hong/.local/opt/emacs/
  '--program-transform-name=s/^ctags$/ctags.emacs/' --with-mailutils
  'CFLAGS=-march=native -O3''

Configured features:
XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY
LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS PDUMPER GMP

Important settings:
   value of $LANG: en_US.UTF-8
   value of $XMODIFIERS: @im=fcitx
   locale-coding-system: utf-8-unix