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: Tassilo Horn
Subject: Re: Sorting with threads in Gnus
Date: Tue, 30 Jul 2013 09:05:28 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

"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

--8<---------------cut here---------------start------------->8---
(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)
--8<---------------cut here---------------end--------------->8---

I get

--8<---------------cut here---------------start------------->8---
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>
--8<---------------cut here---------------end--------------->8---

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.

Bye,
Tassilo




reply via email to

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