From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/15804 Path: news.gmane.org!not-for-mail From: Bastien Newsgroups: gmane.emacs.gnus.user Subject: Re: Sort by thread's size? Date: Tue, 11 Sep 2012 10:52:33 +0200 Message-ID: <87pq5tlz5a.fsf@gnu.org> References: <871uig8nl6.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1347353574 12472 80.91.229.3 (11 Sep 2012 08:52:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2012 08:52:54 +0000 (UTC) Cc: info-gnus-english@gnu.org To: Lars Ingebrigtsen Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Tue Sep 11 10:52:56 2012 Return-path: Envelope-to: gegu-info-gnus-english@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 1TBMDE-0008M9-GC for gegu-info-gnus-english@m.gmane.org; Tue, 11 Sep 2012 10:52:52 +0200 Original-Received: from localhost ([::1]:44304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBMDB-0001mQ-3e for gegu-info-gnus-english@m.gmane.org; Tue, 11 Sep 2012 04:52:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBMD2-0001mE-5m for info-gnus-english@gnu.org; Tue, 11 Sep 2012 04:52:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBMCt-0000it-Sh for info-gnus-english@gnu.org; Tue, 11 Sep 2012 04:52:40 -0400 Original-Received: from mail-wi0-f171.google.com ([209.85.212.171]:52673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBMCt-0000in-Lh for info-gnus-english@gnu.org; Tue, 11 Sep 2012 04:52:31 -0400 Original-Received: by wibhq4 with SMTP id hq4so2807657wib.12 for ; Tue, 11 Sep 2012 01:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=iuu9iLrAjyafq1Ib7BhS++GSMsQ17l4YPul6m8V6Wxc=; b=mfXO8z15KhrJTHgtV8qN8z3/kHfh7qG3q0XCZxJcVLBW+bNCF7SjFy2SmzeBJr74vt vzY+B846QSve5lIeAL3ZLD5cG8Dfv0QyCv/0kMBi6vNc4c5YdSXb+8HmvBDucXktTrx7 GevvJOflPgPeYkswWt96iwKwgBpqo7quwUkxHSWmtR3RAL5mGUGCDTmBtg1CpAYCTa3K 9pVYqrFbOjPKM1WzCLrGpuswekW2eKj6S9Wc1LR2YQ6DgecsE4flruWYvDYNhiRqWvt/ 6qzOFVBbTwsyLfjUsqmcstj6AEybzQGC0o6vevL6Nr4B9qOoMTEM7A+wKsL10IW3u6tV TUFQ== Original-Received: by 10.216.137.193 with SMTP id y43mr8280302wei.71.1347353550594; Tue, 11 Sep 2012 01:52:30 -0700 (PDT) Original-Received: from myhost.localdomain (mar75-2-81-56-68-112.fbx.proxad.net. [81.56.68.112]) by mx.google.com with ESMTPS id el6sm1590020wib.8.2012.09.11.01.52.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 01:52:29 -0700 (PDT) Original-Received: by myhost.localdomain (Postfix, from userid 1000) id DFFD589A2; Tue, 11 Sep 2012 10:52:33 +0200 (CEST) In-Reply-To: <871uig8nl6.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 05 Sep 2012 18:02:29 +0200") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.171 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:15804 Archived-At: Lars Ingebrigtsen writes: > Bastien writes: > >> I'd like to sort emails in a group by threads' size. > > I don't think Gnus has any built-in functionality for doing that, but it > shouldn't be that difficult to write yourself. Thanks! This is what I use now: (defun gnus-thread-sort-by-length (h1 h2) "Sort threads by the sum of all articles in the thread." (> (gnus-thread-total-length h1) (gnus-thread-total-length h2))) (defun gnus-thread-total-length (thread) "Find the total number of articles in THREAD." (cond ((null thread) 0) ((listp thread) (length thread)))) (setq gnus-thread-sort-functions '(gnus-thread-sort-by-number gnus-thread-sort-by-articles-number)) It seems to work fine. `gnus-thread-total-length' is simpler than `gnus-thread-total-score' but I think it does the right thing -- please double-check. Feel free to integrate this in Gnus if this is useful enough. I use it when catching up on mailing lists and groups: short threads are likely to be treated in 2 minutes, while long ones require more attention/reading/brain. -- Bastien