Gnus development mailing list
 help / color / mirror / Atom feed
* Sort recent threads towards bottom when gathering threads by subject?
@ 2017-02-14 23:17 John Magolske
  2017-02-15 13:14 ` Andreas Schwab
  2017-04-07 23:47 ` John Magolske
  0 siblings, 2 replies; 4+ messages in thread
From: John Magolske @ 2017-02-14 23:17 UTC (permalink / raw)
  To: ding


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.

Any suggestions or clues much appreciated!

John


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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sort recent threads towards bottom when gathering threads by subject?
  2017-02-14 23:17 Sort recent threads towards bottom when gathering threads by subject? John Magolske
@ 2017-02-15 13:14 ` Andreas Schwab
  2017-02-16 22:43   ` John Magolske
  2017-04-07 23:47 ` John Magolske
  1 sibling, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2017-02-15 13:14 UTC (permalink / raw)
  To: John Magolske; +Cc: ding

On Feb 14 2017, John Magolske <listmail@b79.net> wrote:

> 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.

IIUC you can get what you want if you use `(not
gnus-thread-sort-by-most-recent-number)' as the element of
gnus-thread-sort-functions.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sort recent threads towards bottom when gathering threads by subject?
  2017-02-15 13:14 ` Andreas Schwab
@ 2017-02-16 22:43   ` John Magolske
  0 siblings, 0 replies; 4+ messages in thread
From: John Magolske @ 2017-02-16 22:43 UTC (permalink / raw)
  To: ding

Andreas Schwab <schwab@linux-m68k.org> writes:
> On Feb 14 2017, John Magolske <listmail@b79.net> wrote:
>
>> 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.
>
> IIUC you can get what you want if you use
> `(not gnus-thread-sort-by-most-recent-number)'
> as the element of gnus-thread-sort-functions.

I have tried that...well, actually I was using this:

    (setq gnus-thread-sort-functions
          '((not gnus-thread-sort-by-most-recent-number)
            (not gnus-thread-sort-by-most-recent-date)))

Per your suggestion I also tried:

    (setq gnus-thread-sort-functions
          '((not gnus-thread-sort-by-most-recent-number)))

In both cases this only gets the order I want (most recent message /
thread with most recent message ordered towards bottom) when gathering
threads by reference. When gathering threads by subject, messages are
ordered towards the bottom with sorting done by the root/oldest message
of threads rather than the most recent message. I'm still getting:

    A (2 Feb 13:49)
    └─► A (4 Feb 20:05)
    B (2 Feb 18:09)
    C (5 Feb 01:19)

I included various other threading-related settings in my previous post
thinking there might be some other factors contributing to this.

Thoughts?

John

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sort recent threads towards bottom when gathering threads by subject?
  2017-02-14 23:17 Sort recent threads towards bottom when gathering threads by subject? John Magolske
  2017-02-15 13:14 ` Andreas Schwab
@ 2017-04-07 23:47 ` John Magolske
  1 sibling, 0 replies; 4+ messages in thread
From: John Magolske @ 2017-04-07 23:47 UTC (permalink / raw)
  To: ding

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-07 23:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14 23:17 Sort recent threads towards bottom when gathering threads by subject? John Magolske
2017-02-15 13:14 ` Andreas Schwab
2017-02-16 22:43   ` John Magolske
2017-04-07 23:47 ` John Magolske

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).