Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Sorting threads after gathering threads
@ 2014-07-27 22:27 Michael Welsh Duggan
  2014-08-12  0:15 ` Dan Christensen
  2014-08-12 11:20 ` N. Raghavendra
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Welsh Duggan @ 2014-07-27 22:27 UTC (permalink / raw)
  To: info-gnus-english

I am on an automated mailing list which I automatically filter into a
separate Gnus group.  Each message on this list is an individual,
non-threaded messages.  Many of these messages are indeed related, and
this can be determined by the subject.  I have put my own
subject-simplifying function in the `gnus-simplify-subject-functions'
variable for this group.  This correctly gathers the individual messages
into threads.

Now the problem: I want to sort the *Summary* buffer like this: Each
thread is sorted from the oldest to the newest message by date.  The
*Summary* buffer is sorted by the most recent date in each thread.

This seems like it should be simple: Set
`gnus-sort-gathered-threads-function' to `gnus-thread-sort-by-date', and
set `gnus-thread-sort-functions' to
`gnus-thread-sort-by-most-recent-date'.  (Well, I lie a little.  I
actually want the reverse of `gnus-thread-sort-by-most-recent-date',
putting the oldest threads at the top, but that's easy to hack.)

But this doesn't seem to do what I want.  It looks like Gnus makes
threads, sorts them, gathers the threads, and then sorts within the
threads.  The upshot is my threads get gathered correctly, and the
messages in a thread are sorted correctly, but the threads are sorted by
(I believe accident) the oldest message in each thread, rather than the
most recent.

Am I doing something wrong?  Is there another way to achieve my desired
result?

-- 
Michael Welsh Duggan
(md5i@md5i.com)



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

* Re: Sorting threads after gathering threads
  2014-07-27 22:27 Sorting threads after gathering threads Michael Welsh Duggan
@ 2014-08-12  0:15 ` Dan Christensen
  2014-08-12 11:20 ` N. Raghavendra
  1 sibling, 0 replies; 9+ messages in thread
From: Dan Christensen @ 2014-08-12  0:15 UTC (permalink / raw)
  To: info-gnus-english

Michael Welsh Duggan <mwd@md5i.com> writes:

> But this doesn't seem to do what I want.  It looks like Gnus makes
> threads, sorts them, gathers the threads, and then sorts within the
> threads.  The upshot is my threads get gathered correctly, and the
> messages in a thread are sorted correctly, but the threads are sorted by
> (I believe accident) the oldest message in each thread, rather than the
> most recent.

You are right that this is what Gnus does, and I agree that it should be
changed.  But there are technical details that would have to be figured
out in order to do that.  See the thread from 2011 that begins with:

  http://thread.gmane.org/gmane.emacs.gnus.general/78745/focus=79015

Dan



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

* Re: Sorting threads after gathering threads
  2014-07-27 22:27 Sorting threads after gathering threads Michael Welsh Duggan
  2014-08-12  0:15 ` Dan Christensen
@ 2014-08-12 11:20 ` N. Raghavendra
  1 sibling, 0 replies; 9+ messages in thread
From: N. Raghavendra @ 2014-08-12 11:20 UTC (permalink / raw)
  To: info-gnus-english

At 2014-07-27T18:27:17-04:00, Michael Welsh Duggan wrote:

> Now the problem: I want to sort the *Summary* buffer like this: Each
> thread is sorted from the oldest to the newest message by date.  The
> *Summary* buffer is sorted by the most recent date in each thread.

I wanted something similar, and Tassilo Horn helped me with that, see
http://thread.gmane.org/gmane.emacs.help/92345/  Here is the relevant
part of my Gnus configuration:

--8<---------------cut here---------------start------------->8---
(setq gnus-thread-sort-functions
      '(gnus-thread-sort-by-number gnus-thread-sort-by-most-recent-date))

(setq gnus-subthread-sort-functions
      '(gnus-thread-sort-by-number gnus-thread-sort-by-date))

(setq gnus-sort-gathered-threads-function 'gnus-thread-sort-by-date)
--8<---------------cut here---------------end--------------->8---

For this to work, you have to use the git version of Gnus. 

Raghavendra.

-- 
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/



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

* Re: Sorting threads after gathering threads
       [not found]       ` <mailman.6268.1406688789.1147.info-gnus-english@gnu.org>
@ 2014-07-30  3:04         ` Emanuel Berg
  0 siblings, 0 replies; 9+ messages in thread
From: Emanuel Berg @ 2014-07-30  3:04 UTC (permalink / raw)
  To: info-gnus-english

Michael Welsh Duggan <mwd@md5i.com> writes:

> You seem to be missing my point. There are no threads
> to start -- or rather, every message is its own
> thread. Then they get sorted by the
> gnus-thread-sort-functions'.

I have several listbots splitted into groups and they
are all threaded. I don't care if they are threads to
begin with, if they are "real" or loose threads, and
all that. They are threads when I open the groups and
look at the summary and that is what matters. I have
shared my options. Why don't you do exactly like me?
Then probably you will get it right.

-- 
underground experts united

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

* Re: Sorting threads after gathering threads
  2014-07-30  0:39     ` Emanuel Berg
@ 2014-07-30  2:52       ` Michael Welsh Duggan
       [not found]       ` <mailman.6268.1406688789.1147.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Welsh Duggan @ 2014-07-30  2:52 UTC (permalink / raw)
  To: info-gnus-english

Emanuel Berg <embe8573@student.uu.se> writes:

> Michael Welsh Duggan <mwd@md5i.com> writes:
>
>> The important part here is that these are not real
>> threads. They are individual messages with enough
>> similarities that threading can be simulated. In Gnus
>> parlance, they are "loose threads," and are put
>> together during "thread gathering." Unfortunately, it
>> seems like thread gathering happens after thread
>> sorting, for some unknown reason.
>
> What does the distinction loose or real thread matter?
> Why can't you have them all grouped by subject and then
> sorted by number (or date) within each group?

You seem to be missing my point.  There are no threads to start -- or
rather, every message is its own thread.  Then they get sorted by the
`gnus-thread-sort-functions'.  Then the remaining threads (all
individual messages still) are gathered as loose threads into real
threads.  Then the messages are sorted within each gathered thread.  But
the threads are no longer properly sorted with respect to each other,
since the sorting was done before the gathering.  See
`gnus-summary-prepare':

    ;; Generate the buffer, either with threads or without.
    (when gnus-newsgroup-headers
      (gnus-summary-prepare-threads
       (if gnus-show-threads
	   (gnus-sort-gathered-threads
	    (funcall gnus-summary-thread-gathering-function
		     (gnus-sort-threads
		      (gnus-cut-threads (gnus-make-threads)))))
	 ;; Unthreaded display.
	 (gnus-sort-articles gnus-newsgroup-headers))))

I am wondering why the sorting (of threads) happens before the gathering
into threads.

-- 
Michael Welsh Duggan
(md5i@md5i.com)



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

* Re: Sorting threads after gathering threads
       [not found]   ` <mailman.6260.1406678726.1147.info-gnus-english@gnu.org>
  2014-07-30  0:39     ` Emanuel Berg
@ 2014-07-30  0:48     ` Emanuel Berg
  1 sibling, 0 replies; 9+ messages in thread
From: Emanuel Berg @ 2014-07-30  0:48 UTC (permalink / raw)
  To: info-gnus-english

Michael Welsh Duggan <mwd@md5i.com> writes:

> The important part here is that these are not real
> threads. They are individual messages with enough
> similarities that threading can be simulated. In Gnus
> parlance, they are "loose threads," and are put
> together during "thread gathering." Unfortunately, it
> seems like thread gathering happens after thread
> sorting, for some unknown reason.

Check out `gnus-summary-thread-gathering-function'.
I have that gnus-gather-threads-by-subject.

    ... Function used for gathering loose threads.
    There are two pre-defined functions:
    `gnus-gather-threads-by-subject', which only takes
    Subjects into consideration; and
    `gnus-gather-threads-by-references', which compared
    the References headers of the articles to find
    matches.

-- 
underground experts united

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

* Re: Sorting threads after gathering threads
       [not found]   ` <mailman.6260.1406678726.1147.info-gnus-english@gnu.org>
@ 2014-07-30  0:39     ` Emanuel Berg
  2014-07-30  2:52       ` Michael Welsh Duggan
       [not found]       ` <mailman.6268.1406688789.1147.info-gnus-english@gnu.org>
  2014-07-30  0:48     ` Emanuel Berg
  1 sibling, 2 replies; 9+ messages in thread
From: Emanuel Berg @ 2014-07-30  0:39 UTC (permalink / raw)
  To: info-gnus-english

Michael Welsh Duggan <mwd@md5i.com> writes:

> The important part here is that these are not real
> threads. They are individual messages with enough
> similarities that threading can be simulated. In Gnus
> parlance, they are "loose threads," and are put
> together during "thread gathering." Unfortunately, it
> seems like thread gathering happens after thread
> sorting, for some unknown reason.

What does the distinction loose or real thread matter?
Why can't you have them all grouped by subject and then
sorted by number (or date) within each group?

> With the settings as in my original mail (which you
> have cut out of this response)

Yeah?

-- 
underground experts united

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

* Re: Sorting threads after gathering threads
  2014-07-27 22:55 ` Emanuel Berg
@ 2014-07-30  0:04   ` Michael Welsh Duggan
       [not found]   ` <mailman.6260.1406678726.1147.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Welsh Duggan @ 2014-07-30  0:04 UTC (permalink / raw)
  To: info-gnus-english

Emanuel Berg <embe8573@student.uu.se> writes:

> Michael Welsh Duggan <mwd@md5i.com> writes:
>
>> I am on an automated mailing list which I
>> automatically filter into a separate Gnus group. Each
>> message on this list is an individual, non-threaded
>> messages. Many of these messages are indeed related,
>> and this can be determined by the subject. I have put
>> my own subject-simplifying function in the
>> gnus-simplify-subject-functions' variable for this
>> group. This correctly gathers the individual messages
>> into threads ...
>
> To split listbots into groups is very common and of
> course the mails/posts should be threaded.

The important part here is that these are not real threads.  They are
individual messages with enough similarities that threading can be
simulated.  In Gnus parlance, they are "loose threads," and are put
together during "thread gathering."  Unfortunately, it seems like thread
gathering happens after thread sorting, for some unknown reason.

> I have:
>
> `gnus-sort-gathered-threads-function' is gnus-thread-sort-by-number
> `gnus-thread-sort-functions' is (gnus-thread-sort-by-number)
>
> which I didn't configure.
>
> In the help for `gnus-thread-sort-functions', it says:
>
>     You should probably always include
>     `gnus-thread-sort-by-number' in the list of sorting
>     functions -- preferably first. Also note that
>     sorting by date is often much slower than sorting
>     by number, and the sorting order is very
>     similar. (Sorting by date means sorting by the time
>     the message was sent, sorting by number means
>     sorting by arrival time.
>
> The result looks like this:
>
> http://user.it.uu.se/~embe8573/dumps/gnus-group-mailing-list-threads.png
>
> I think that is the standard look with respect to
> sorting, because, as I said, I didn't configure that.
>
> Compared to that, (what I can see) group threads by
> subject, within those by time (actually number), with
> the most recent last - compared to that, what is it you
> would like to you change? (You probably already wrote
> that but it was hard to make out with all the other
> material you provided.)

With the settings as in my original mail (which you have cut out of this
response), the pseudo-threads (loose threads) are being gathered
properly, but the threads are not being sorted in the buffer by the
latest date in each thread, but rather by what appears to be date of the
first article in each thread.

-- 
Michael Welsh Duggan
(md5i@md5i.com)



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

* Re: Sorting threads after gathering threads
       [not found] <mailman.6108.1406500221.1147.info-gnus-english@gnu.org>
@ 2014-07-27 22:55 ` Emanuel Berg
  2014-07-30  0:04   ` Michael Welsh Duggan
       [not found]   ` <mailman.6260.1406678726.1147.info-gnus-english@gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Emanuel Berg @ 2014-07-27 22:55 UTC (permalink / raw)
  To: info-gnus-english

Michael Welsh Duggan <mwd@md5i.com> writes:

> I am on an automated mailing list which I
> automatically filter into a separate Gnus group. Each
> message on this list is an individual, non-threaded
> messages. Many of these messages are indeed related,
> and this can be determined by the subject. I have put
> my own subject-simplifying function in the
> gnus-simplify-subject-functions' variable for this
> group. This correctly gathers the individual messages
> into threads ...

To split listbots into groups is very common and of
course the mails/posts should be threaded.

I have:

`gnus-sort-gathered-threads-function' is gnus-thread-sort-by-number
`gnus-thread-sort-functions' is (gnus-thread-sort-by-number)

which I didn't configure.

In the help for `gnus-thread-sort-functions', it says:

    You should probably always include
    `gnus-thread-sort-by-number' in the list of sorting
    functions -- preferably first. Also note that
    sorting by date is often much slower than sorting
    by number, and the sorting order is very
    similar. (Sorting by date means sorting by the time
    the message was sent, sorting by number means
    sorting by arrival time.

The result looks like this:

http://user.it.uu.se/~embe8573/dumps/gnus-group-mailing-list-threads.png

I think that is the standard look with respect to
sorting, because, as I said, I didn't configure that.

Compared to that, (what I can see) group threads by
subject, within those by time (actually number), with
the most recent last - compared to that, what is it you
would like to you change? (You probably already wrote
that but it was hard to make out with all the other
material you provided.)

-- 
underground experts united

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

end of thread, other threads:[~2014-08-12 11:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-27 22:27 Sorting threads after gathering threads Michael Welsh Duggan
2014-08-12  0:15 ` Dan Christensen
2014-08-12 11:20 ` N. Raghavendra
     [not found] <mailman.6108.1406500221.1147.info-gnus-english@gnu.org>
2014-07-27 22:55 ` Emanuel Berg
2014-07-30  0:04   ` Michael Welsh Duggan
     [not found]   ` <mailman.6260.1406678726.1147.info-gnus-english@gnu.org>
2014-07-30  0:39     ` Emanuel Berg
2014-07-30  2:52       ` Michael Welsh Duggan
     [not found]       ` <mailman.6268.1406688789.1147.info-gnus-english@gnu.org>
2014-07-30  3:04         ` Emanuel Berg
2014-07-30  0:48     ` Emanuel Berg

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