help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting with threads in Gnus


From: Eric Abrahamsen
Subject: Re: Sorting with threads in Gnus
Date: Tue, 30 Jul 2013 15:24:14 +0800
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux)

Tassilo Horn <tsdh@gnu.org> writes:

> "N. Raghavendra" <raghu@hri.res.in> writes:
>
>>> I think this does what you want (please load it after loading Gnus):
>>>
>>> (setq gnus-sort-gathered-threads-function
>>>       #'gnus-thread-sort-by-number)
>>> (setq gnus-thread-sort-functions
>>>       '((not gnus-thread-sort-by-number)))
>>>
>>> (defun gnus-sort-threads-recursive (threads func)
>>>   (sort (mapcar (lambda (thread)
>>>               (cons (car thread)
>>>                     (and (cdr thread)
>>>                          (gnus-sort-threads-recursive-1
>>>                           (cdr thread) func))))
>>>             threads) func))
>>>
>>> (defun gnus-sort-threads-recursive-1 (threads func)
>>>   (setq func (gnus-make-sort-function
>>>           '(gnus-thread-sort-by-number)))
>>>   (sort (mapcar (lambda (thread)
>>>               (cons (car thread)
>>>                     (and (cdr thread)
>>>                          (gnus-sort-threads-recursive-1
>>>                           (cdr thread) func))))
>>>             threads) func))
>>>
>>> Is that right?
>>
>> Thanks.  I'll try it and get back.
>
> I think Michael might be correct, and still sorting of inner threads
> according to date or number is needed.  I've changed that now in the
> Gnus code.  So if `gnus-sort-threads-recursively' is nil, then
> subthreads are explicitly sorted by date.
>
> Now using
>
> (setq gnus-thread-sort-functions
>       '(gnus-thread-sort-by-number
>       gnus-thread-sort-by-most-recent-date
>         gnus-thread-sort-by-date
>       gnus-thread-sort-by-total-score)
>       gnus-sort-gathered-threads-function 'gnus-thread-sort-by-date
>       gnus-sort-threads-recursively nil)
>
> I get
>
> O ┃ +┃Chris Seberino         ┃ ╭●  Trouble binding Alt...
> O ┃ +┃Pascal J. Bourguignon  ┃ ├──❯   <Jul 07 2013 00:16>
> O ┃ +┃Peter Dyballa          ┃ ├──❯   <Jul 07 2013 00:21>
> O ┃ +┃Bob Proulx             ┃ ├──❯   <Jul 07 2013 04:44>
> R ┃ +┃Yuri Khan              ┃ ├──❯   <Jul 07 2013 05:49>
> O ┃ +┃Chris Seberino         ┃ ├──❯   <Jul 07 2013 07:08>
> O ┃ +┃Raffaele Ricciardi     ┃ │├──❯   <Jul 07 2013 14:24>
> O ┃ +┃Pascal J. Bourguignon  ┃ │╰──❯   <Jul 07 2013 14:51>
> O ┃ +┃Chris Seberino         ┃ │ ╰──❯   <Jul 07 2013 22:50>
> O ┃ +┃Pascal J. Bourguignon  ┃ │  ╰──❯   <Jul 08 2013 00:06>
> Q ┃  ┃                       ┃ ╰──❯   <Jul 07 2013 14:49>
> O ┃ +┃Pascal J. Bourguignon  ┃  ╰──❯   <Jul 07 2013 14:49>
>
> That's actually the same as the order I had before my latest change, but
> maybe that was only a coincidence.  At least it seems more correct to
> explicitly sort subthreads chronologically instead of not sorting them
> at all.

I think it defaults to sorting by article number, which often looks a
lot like date -- docs seem to say that one is dependent on when the
message is sent, and the other on when it arrives...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]