Gnus development mailing list
 help / color / mirror / Atom feed
From: John Magolske <listmail@b79.net>
To: ding@gnus.org
Subject: Re: Sort recent threads towards bottom when gathering threads by subject?
Date: Fri, 07 Apr 2017 16:47:10 -0700	[thread overview]
Message-ID: <87lgrbhjb5.fsf@b79.net> (raw)
In-Reply-To: <87shngnz0m.fsf@b79.net> (John Magolske's message of "Tue, 14 Feb 2017 15:17:13 -0800")

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

I found a solution to this in the post "Sorting threads after gathering
threads" [1], and some bug reports [2] [3]. I used the patch in [2]
against gnus-sum.el, placing the relevant parts into a function that I
call from my gnus init file. I've attached the function here, and that
along with something like:

    (load "~/.emacs.d/gnus/gathered-threads-by-subject-sort.el")

is the *only* way I've found to get the sorting order I want when
gathering threads by subject in Gnus -- sorting the most recent threads
towards the bottom with sorting done by the most recent message rather
than the root/oldest message of threads.

[1] http://emacs.1067599.n8.nabble.com/bug-21462-25-0-50-Gnus-thread-gathering-and-sorting-inverted-td368462.html
[2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18156
[3] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21462


[-- Attachment #2: function to sort the most recent threads towards the bottom when gathering threads by subject in Gnus --]
[-- Type: application/emacs-lisp, Size: 2535 bytes --]

[-- Attachment #3: Type: text/plain, Size: 3777 bytes --]


Regards,

John

John Magolske <listmail@b79.net> writes:
> 
> For a mailing list with no Message-ID References or In-Reply-To headers,
> I gather messages with the same subject line together:
>
>     (setq gnus-summary-thread-gathering-function
>           'gnus-gather-threads-by-subject)
>
> And I'd like to have threads sorted so that the most recent individual
> message or thread with the most recent message is ordered towards the
> bottom. Here's a simplified representation of actual messages in the
> group in question (nnimap+imap-mail btw) showing the closest I can get.
> All date/time values are from the "Received:" header and in UTC :
>
>     A (2 Feb 13:49)
>     └─► A (4 Feb 20:05)
>     B (2 Feb 18:09)
>     C (5 Feb 01:19)
>
> This is not the order of message threads I'm looking for, as message "B"
> is positioned more recent than thread "A", even though the most recent
> message in thread "A" is more recent than message "B". What I'd like to
> have is this:
>
>     B (2 Feb 18:09)
>     A (2 Feb 13:49)
>     └─► A 4 Feb 20:05)
>     C (5 Feb 01:19)
>
> But no combination of values for gnus-thread-sort-functions,
> gnus-sort-gathered-threads-function, gnus-subthread-sort-functions, etc.
> will make this happen. I can get this thread sorting order in groups
> that have the appropriate headers to allow gathering threads by
> reference with:
>
>     (setq gnus-summary-thread-gathering-function
>     'gnus-gather-threads-by-references)
>
> ...but not when gathering threads by subject. My current settings are:
>
>     (setq gnus-show-threads t)
>     (setq gnus-fetch-old-headers t)
>     (setq gnus-thread-ignore-subject t)
>     (setq-default gnus-summary-make-false-root 'adopt)
>     (setq-default gnus-summary-make-false-root-always nil)
>     (setq gnus-sort-gathered-threads-function 'gnus-thread-sort-by-date)
>     (setq gnus-summary-gather-subject-limit 20)
>     (setq gnus-summary-thread-gathering-function
>           'gnus-gather-threads-by-subject)
>     (setq gnus-thread-sort-functions
>           '((not gnus-thread-sort-by-most-recent-number)
>             (not gnus-thread-sort-by-most-recent-date)))
>     (setq gnus-subthread-sort-functions
>           '(gnus-thread-sort-by-number
>             (gnus-thread-sort-by-most-recent-date)))
>     (setq gnus-article-sort-functions
>           '((not gnus-article-sort-by-most-recent-date)))
>
> By changing gnus-thread-sort-functions to this:
>
>     (setq gnus-thread-sort-functions)
>           '(gnus-thread-sort-by-most-recent-number)
>             gnus-thread-sort-by-most-recent-date)))
>
> I can order threads how I'd like, but most recent messages & threads
> with most recent message will be sorted towards the top like so:
>
>     C (5 Feb 01:19)
>     A (2 Feb 13:49)
>     └─► A (4 Feb 20:05)
>     B (2 Feb 18:09)
>
> Here thread "A" is ahead of message "B" as the most recent message in
> thread "A" is newer than "B". I'd like to have that sorting order, but
> towards the bottom, and cannot figure out how to accomplish this. It
> seems sorting is being done by the root/oldest message of threads rather
> than the most recent message, which leads to the problem of new messages
> sometimes being missed as they get pushed back above long threads. The
> only solution I can come up with is to sort unthreaded by date towards
> the bottom:
>
>     (setq gnus-show-threads nil)
>     (gnus-summary-sort-by-most-recent-date)
>
> which displays like so:
>
>     A (2 Feb 13:49)
>     B (2 Feb 18:09)
>     A (4 Feb 20:05)
>     C (5 Feb 01:19)
>
> But I'd rather have messages gathered by subject.
>


-- 
John Magolske
http://b79.net/contact

      parent reply	other threads:[~2017-04-07 23:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 23:17 John Magolske
2017-02-15 13:14 ` Andreas Schwab
2017-02-16 22:43   ` John Magolske
2017-04-07 23:47 ` John Magolske [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lgrbhjb5.fsf@b79.net \
    --to=listmail@b79.net \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).