From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Sorting with threads in Gnus Date: Tue, 30 Jul 2013 15:24:14 +0800 Message-ID: <877gg8a4td.fsf@ericabrahamsen.net> References: <87d2q8qy0h.fsf@ericabrahamsen.net> <87vc40drow.fsf@thinkpad.tsdh.org> <871u6mlyx5.fsf@ericabrahamsen.net> <87iozxq3ca.fsf@thinkpad.tsdh.org> <87d2q5lmo3.fsf@ericabrahamsen.net> <87ppu5wjw8.fsf@thinkpad.tsdh.org> <87li4twiy9.fsf@thinkpad.tsdh.org> <87ehalwi6j.fsf@thinkpad.tsdh.org> <871u6li5im.fsf@griffin.dhcp1.hri> <8738r0v0s8.fsf@thinkpad.tsdh.org> <87bo5nduu4.fsf@griffin.dhcp1.hri> <87d2q3az79.fsf@web.de> <87k3kbc8t8.fsf@griffin.dhcp1.hri> <87ppu2ua43.fsf@web.de> <87a9l6d5h5.fsf@griffin.dhcp1.hri> <87li4ocytj.fsf@thinkpad.tsdh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1375169056 5808 80.91.229.3 (30 Jul 2013 07:24:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Jul 2013 07:24:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 30 09:24:18 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V44I5-0003Uy-1f for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Jul 2013 09:24:17 +0200 Original-Received: from localhost ([::1]:40129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V44I4-00028t-J8 for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Jul 2013 03:24:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V44Ho-00028U-Ue for help-gnu-emacs@gnu.org; Tue, 30 Jul 2013 03:24:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V44Hh-0003ya-B2 for help-gnu-emacs@gnu.org; Tue, 30 Jul 2013 03:24:00 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:40499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V44Hh-0003yV-0w for help-gnu-emacs@gnu.org; Tue, 30 Jul 2013 03:23:53 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V44He-0003FJ-8z for help-gnu-emacs@gnu.org; Tue, 30 Jul 2013 09:23:50 +0200 Original-Received: from 50.56.99.223 ([50.56.99.223]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Jul 2013 09:23:50 +0200 Original-Received: from eric by 50.56.99.223 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Jul 2013 09:23:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 71 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 50.56.99.223 User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:1RZjG5k19Yqmpezbp7YofaH4S20= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92529 Archived-At: Tassilo Horn writes: > "N. Raghavendra" 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 ┃ ├──❯ > O ┃ +┃Peter Dyballa ┃ ├──❯ > O ┃ +┃Bob Proulx ┃ ├──❯ > R ┃ +┃Yuri Khan ┃ ├──❯ > O ┃ +┃Chris Seberino ┃ ├──❯ > O ┃ +┃Raffaele Ricciardi ┃ │├──❯ > O ┃ +┃Pascal J. Bourguignon ┃ │╰──❯ > O ┃ +┃Chris Seberino ┃ │ ╰──❯ > O ┃ +┃Pascal J. Bourguignon ┃ │ ╰──❯ > Q ┃ ┃ ┃ ╰──❯ > O ┃ +┃Pascal J. Bourguignon ┃ ╰──❯ > > 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...