GNU bug report logs - #21462
25.0.50; Gnus thread gathering and sorting inverted

Previous Next

Packages: emacs, gnus;

Reported by: Michael Welsh Duggan <mwd <at> md5i.com>

Date: Fri, 11 Sep 2015 17:35:02 UTC

Severity: minor

Merged with 18156

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 21462 <at> debbugs.gnu.org (full text, mbox):

From: Michael Welsh Duggan <mwd <at> md5i.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Michael Welsh Duggan <mwd <at> md5i.com>, 21462 <at> debbugs.gnu.org
Subject: Re: bug#21462: 25.0.50; Gnus thread gathering and sorting inverted
Date: Sun, 07 Feb 2016 02:40:48 -0500
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Michael Welsh Duggan <mwd <at> md5i.com> writes:
>
>> I have been attempting to implement the following use case:
>>
>> I have a gnus group that receives messages with subjects that look sort
>> of like this:
>>
>> Some title, part 1, by X
>> Some title, part 2, by X
>> Some other title, part 32, by Y
>>
>> I gather these into threads by title using my own simplification
>> function which I add to `gnus-simplify-subject-functions' in this
>> group.  I also set `gnus-thread-hide-subtree' to `t' in this group, so
>> each title takes up one Summary line.
>>
>> I then want to sort these threads by the *latest* message in the
>> thread.  Thus, when a new part is received, the entire thread shows up
>> as "newer".  To do this, I created by own function to set
>> `gnus-thread-sort-functions' to.  This looks like this:
>>
>> (defun md5i-thread-sort-by-most-recent-date-reverse (h1 h2)
>>   (<= (gnus-thread-latest-date h1) (gnus-thread-latest-date h2)))
>>
>> Unfortunately, this fails in many cases due to the fact that
>> `gnus-summary-prepare' gathers thread after sorting threads.  In my case
>> I need the reverse, and I think that the reverse always makes sense.  I
>> have a patch which does this, and has been working for me for half a
>> year or so.  I suggest you add this or an equivalent change to Gnus.
>> Feel free to rewrite this patch completely.  I wrote it long enough ago
>> that I do not remember why I needed to create `gnus-make-threaded-sort'.
>
> There is a separater `gnus-sort-gathered-threads-function' -- doesn't it
> do what you want it to?

I don't think so.  At least not according to how I understand the
documentation and how I read the sources.  gnus-sort-gathered-threads
looks like it sorts the articles _within_ a gathered thread.  The
process is:

From gnus-summary-prepare:

1) gnus-make-threads -> gathers articles into threads by ref
2) gnus-cut-threads  -> removes "uninteresting" articles from the
   threads
3) gnus-sort-threads -> sorts the threads (with respect to each other thread)
4) gnus-summary-thread-gathering-function -> gathers threads with
   similar characteristics (subject, reference) into a single thread
5) gnus-sort-gathered-threads -> sorts the articles within each thread

My argument is that steps 3 and 4 are backwards.  Step 4 is the place
where the final thread groupings are decided, and sorting these threads
with respect to each other should happen afterward.

-- 
Michael Welsh Duggan
(md5i <at> md5i.com)




This bug report was last modified 8 years and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.