From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "N. Raghavendra" Newsgroups: gmane.emacs.help Subject: Re: Sorting with threads in Gnus Date: Sun, 28 Jul 2013 21:47:10 +0530 Message-ID: <87a9l6d5h5.fsf@griffin.dhcp1.hri> 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> Reply-To: "N. Raghavendra" NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1375028265 13026 80.91.229.3 (28 Jul 2013 16:17:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jul 2013 16:17:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 28 18:17:47 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 1V3TfG-0007F0-G4 for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jul 2013 18:17:46 +0200 Original-Received: from localhost ([::1]:46352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3TfG-0004ne-2I for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jul 2013 12:17:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3Tey-0004f0-NK for help-gnu-emacs@gnu.org; Sun, 28 Jul 2013 12:17:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3Tet-0002lT-2q for help-gnu-emacs@gnu.org; Sun, 28 Jul 2013 12:17:28 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:42992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3Tes-0002lK-RM for help-gnu-emacs@gnu.org; Sun, 28 Jul 2013 12:17:22 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V3Ter-00071l-K7 for help-gnu-emacs@gnu.org; Sun, 28 Jul 2013 18:17:21 +0200 Original-Received: from 14.139.59.140 ([14.139.59.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 28 Jul 2013 18:17:21 +0200 Original-Received: from raghu by 14.139.59.140 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 28 Jul 2013 18:17:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 14.139.59.140 User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:TOasjNqTouH8fazv0qqyl6B/rvM= 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:92492 Archived-At: At 2013-07-28T14:45:00+02:00, Michael Heerdegen wrote: > 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. Best regards, Raghu. -- N. Raghavendra , http://www.retrotexts.net/ Harish-Chandra Research Institute, http://www.hri.res.in/