Subject: bug#67954: 30.0.50; Gnus: notmuch results are not sorted properly

From: Eric Abrahamsen <[email-masked]>
Date: Thu, 21 Dec 2023 13:34:45 -0800

Torsten Bronger <[email-masked]> writes:

> If I search for mails using Gnus and notmuch.  My .gnus says:
>
> (setq gnus-secondary-select-methods
>       '((nnml "" (gnus-search-engine gnus-search-notmuch)))
>       gnus-search-notmuch-config-file "/etc/notmuch/.notmuch-config")
>
> Then I press ^ in group mode, move to the nnml: entry, and press G.
> Then, I enter my query string, which starts the search.  Gnus asks how
> many articles I want to have, and here the problem begins: If 1000 mails
> have been found and I want to see 10, I expect to see the 10 most recent
> ones.  However, they seem to be arbitrary.  At least, they are not the
> 10 first/latest delivered by notmuch (which works in newest-first mode).
>
> If I retrieve all 1000 mails, they are also not sorted in the summary
> buffer.  I can hit C-c C-s C-d without effect.  The sorting seems to be
> random.

Weird! Thanks for the report. I've piled up a few gnus-search bugs and
will work on them in the next few days, if necessary I'll come back for
more info then.