From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Sorting with threads in Gnus Date: Tue, 30 Jul 2013 09:05:28 +0200 Message-ID: <87li4ocytj.fsf@thinkpad.tsdh.org> 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> 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 1375167970 25777 80.91.229.3 (30 Jul 2013 07:06:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Jul 2013 07:06:10 +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:06:11 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 1V440T-0002sQ-BR for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Jul 2013 09:06:05 +0200 Original-Received: from localhost ([::1]:33035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V440Q-0004x7-RY for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Jul 2013 03:06:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V440C-0004wu-7g for help-gnu-emacs@gnu.org; Tue, 30 Jul 2013 03:05:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4404-0006gI-Mu for help-gnu-emacs@gnu.org; Tue, 30 Jul 2013 03:05:48 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:42032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4404-0006g3-G7 for help-gnu-emacs@gnu.org; Tue, 30 Jul 2013 03:05:40 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V4402-0002fs-Bn for help-gnu-emacs@gnu.org; Tue, 30 Jul 2013 09:05:38 +0200 Original-Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Jul 2013 09:05:38 +0200 Original-Received: from tsdh by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Jul 2013 09:05:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 72 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:hH67vhGsndTaInS0jq4/hEIZ3Ho= 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:92528 Archived-At: "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 --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 ┃ ├──❯ 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 ┃ ╰──❯ --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