From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Sorting with threads in Gnus Date: Sun, 28 Jul 2013 14:45:00 +0200 Message-ID: <87ppu2ua43.fsf@web.de> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1375015554 19708 80.91.229.3 (28 Jul 2013 12:45:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jul 2013 12:45:54 +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 14:45:54 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 1V3QME-0002k0-Mm for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jul 2013 14:45:54 +0200 Original-Received: from localhost ([::1]:40312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3QME-00071E-6L for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jul 2013 08:45:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3QLl-0006oN-Fg for help-gnu-emacs@gnu.org; Sun, 28 Jul 2013 08:45:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3QLf-00022T-2W for help-gnu-emacs@gnu.org; Sun, 28 Jul 2013 08:45:25 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:47575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3QLa-00021u-W8 for help-gnu-emacs@gnu.org; Sun, 28 Jul 2013 08:45:18 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V3QLY-0002MP-Ar for help-gnu-emacs@gnu.org; Sun, 28 Jul 2013 14:45:12 +0200 Original-Received: from ip-2-201-181-50.web.vodafone.de ([2.201.181.50]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 28 Jul 2013 14:45:12 +0200 Original-Received: from michael_heerdegen by ip-2-201-181-50.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 28 Jul 2013 14:45:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 61 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-2-201-181-50.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:FOJOoBsx347s+hP/8Nf4vKgbsdg= 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:92486 Archived-At: --=-=-= Content-Type: text/plain "N. Raghavendra" writes: > I did, but the order remains the same as in my previous message. Sorry, after reading your original post again, I only now understand what you want to reach. AFAICT, this isn't possible by default. Sorting threads at the top level and recursively is done according to the same setting: `gnus-thread-sort-functions'. So, I think what your see is expected. To get what you want, you AFAIK must rewrite `gnus-sort-threads-recursive' so that it handles the top-level specially. I think this does what you want (please load it after loading Gnus): --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=threads.el Content-Transfer-Encoding: quoted-printable (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)) --=-=-= Content-Type: text/plain Is that right? Regards, Michael. --=-=-=--