Gnus development mailing list
 help / color / mirror / Atom feed
From: Dan Christensen <jdc@uwo.ca>
To: ding@gnus.org
Subject: Re: Problem with thread sorting
Date: Sat, 04 Jun 2011 20:34:10 -0400	[thread overview]
Message-ID: <87k4d1dsl9.fsf@uwo.ca> (raw)
In-Reply-To: <m34o468r8d.fsf@quimbies.gnus.org>

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> This is how it's done:
>
> 	   (gnus-sort-gathered-threads
> 	    (funcall gnus-summary-thread-gathering-function
> 		     (gnus-sort-threads
> 		      (gnus-cut-threads (gnus-make-threads)))))
>
> First each thread is sorted, then they are gathered, and then the
> threads inside the gathered threads are sorted individually.
>
> You would rather that the threads be gathered first, then the threads
> are sorted (somehow), and then the threads inside the gathered threads
> would be sorted.
>
> However, I don't think that can be done.  Take the default sorting
> parameter now -- sort by root article number.  What's the root article
> number of a gathered thread?  The article number of the first thread?
> The article number of the first thread after sorting the sub-threads?
> Or what?

You are right that a somewhat arbitrary decision needs to be made here.

> So I think what it does now is reasonable.

I think the current way is also arbitrary, but is arbitrary in a way
that can't be controlled.  For example, suppose that before gathering,
the threads are sorted as

Thread 1
Thread 2 *
Thread 3
Thread 4 *
Thread 5

and that threads 2 and 4 are going to be gathered together in the next
step.  I believe that what happens now is that you end up with both in
either the position of thread 2 or thread 4, and that there are no user
settings to control this.  For sorting by root article number, it would
be equivalent to gather the threads first, and then sort them using one
of the arbitrary suggestions you make above, so there is no loss in
switching to this method.  But for sorting functions that traverse the
thread, like most-recent-date, sorting after gathering would produce
correct results.

In principle the current method doesn't really make sense, since why
would you sort things into a list, and then just grab bunches of them
and arbitrarily move them around.  You should instead do the grouping
first, so that the sort function has full information about the final
grouping.

As to how to treat the root, I guess the root of one of the gathered
threads should be simply chosen to be the root.  This could be done
using the existing settings for how gathered threads are handled,
or could be chosen using the sorting function for gathered threads.
Or a dummy root could be greated, and given a virtual article number,
date, score, etc, derived from the gathered threads.

[If I recall correctly, the order of articles within a thread is
controlled by the same sort function as the threads themselves.  If so,
it seems that this could extend to the gathered threads as well,
eliminating the need for a separate sort function to be set by the user.
In which case, the thread sorting function could be used to choose the
root of the thread.]

So there are some issues to sort out (no pun intended), but I think it
could make sorting much better and at least predictable.

Dan

PS: And just to emphasize, the current method seems to *always* get the
sorting wrong when gathering threads sorted by (not most-recent-date).




  reply	other threads:[~2011-06-05  0:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-09 12:12 Peter Münster
2011-05-12 18:20 ` Dan Christensen
2011-05-30 20:27 ` Lars Magne Ingebrigtsen
2011-05-31  7:15   ` Peter Münster
2011-05-31 19:06     ` Lars Magne Ingebrigtsen
2011-06-02 14:10       ` Dan Christensen
2011-06-03 22:14         ` Lars Magne Ingebrigtsen
2011-06-03 22:32           ` Peter Münster
2011-06-03 22:50             ` Lars Magne Ingebrigtsen
2011-06-05  0:34               ` Dan Christensen [this message]
2011-06-26 10:14                 ` Lars Magne Ingebrigtsen

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=87k4d1dsl9.fsf@uwo.ca \
    --to=jdc@uwo.ca \
    --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).