From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/25988 Path: main.gmane.org!not-for-mail From: Shenghuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: Topic sorting Date: 21 Oct 1999 16:41:32 -0400 Organization: U of Rochester Sender: owner-ding@hpc.uh.edu Message-ID: <5bhfjkfnur.fsf@giga.cs.rochester.edu> References: <7t1r9iosjlk.fsf@fly.srk.fer.hr> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035163281 17103 80.91.224.250 (21 Oct 2002 01:21:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:21:21 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id QAA10567 for ; Thu, 21 Oct 1999 16:42:29 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id PAB31437; Thu, 21 Oct 1999 15:42:24 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 21 Oct 1999 15:42:35 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id PAA05699 for ; Thu, 21 Oct 1999 15:42:23 -0500 (CDT) Original-Received: from cayuga.cs.rochester.edu (cayuga.cs.rochester.edu [192.5.53.209]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id QAA10551 for ; Thu, 21 Oct 1999 16:41:43 -0400 (EDT) Original-Received: from giga.cs.rochester.edu (giga.cs.rochester.edu [192.5.53.186]) by cayuga.cs.rochester.edu (8.9.3/Q) with ESMTP id QAA23658 for ; Thu, 21 Oct 1999 16:41:33 -0400 (EDT) Original-Received: (from zsh@localhost) by giga.cs.rochester.edu (8.9.1b+Sun/Q++) id QAA24055; Thu, 21 Oct 1999 16:41:32 -0400 (EDT) Original-To: ding@gnus.org X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q In-Reply-To: Toni Drabik's message of "21 Oct 1999 19:35:03 +0200" Original-Lines: 42 User-Agent: Gnus/5.07009701 (Pterodactyl Gnus v0.97.1) Emacs/20.4 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:25988 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:25988 >>>>> "Toni" == Toni Drabik writes: Toni> It seems to me that there is no easy way to sort group Toni> topics. Gnus manual explains only how to sort groups. I suppose Toni> that I should manually edit `.newsrc.eld' file to change the Toni> order in which topics appear in my *Group* buffer? Toni> Wouldn't it be nice if this could be done in more elegant Toni> fashion? [...] I just wrote the function. I'll put it into CVS if people like it. -- Shenghuo ZHU (defun zsh/gnus-topic-sort-topics-1 (top reverse) (if (cdr top) (let ((subtop (mapcar `(lambda (top) (zsh/gnus-topic-sort-topics-1 top ,reverse)) (sort (cdr top) '(lambda (t1 t2) (string-lessp (caar t1) (caar t2))))))) (setcdr top (if reverse (reverse subtop) subtop)))) top) (defun zsh/gnus-topic-sort-topics (&optional topic reverse) "Sort topics in TOPIC alphabeticaly by topic name. If REVERSE, reverse the sorting order." (interactive (list (completing-read "Sort topic: " gnus-topic-alist nil t (gnus-current-topic)) current-prefix-arg)) (let ((topic-topology (or (and topic (cdr (gnus-topic-find-topology topic))) gnus-topic-topology))) (zsh/gnus-topic-sort-topics-1 topic-topology reverse) (gnus-topic-enter-dribble) (gnus-group-list-groups) (gnus-topic-goto-topic topic)))