From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.bugs Subject: bug#21462: 25.0.50; Gnus thread gathering and sorting inverted Date: Sun, 07 Feb 2016 02:40:48 -0500 Message-ID: <87zivdge7z.fsf@md5i.com> References: <878u8cdfmt.fsf@md5i.com> <87si15awxh.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454830945 5186 80.91.229.3 (7 Feb 2016 07:42:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Feb 2016 07:42:25 +0000 (UTC) Cc: Michael Welsh Duggan , 21462@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 07 08:42:15 2016 Return-path: Envelope-to: geb-bug-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 1aSJz3-0000gy-8e for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Feb 2016 08:42:13 +0100 Original-Received: from localhost ([::1]:60409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSJz2-0004Uq-Hk for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Feb 2016 02:42:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSJyw-0004Uf-Q5 for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 02:42:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSJys-0005jn-TN for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 02:42:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSJys-0005jQ-LB for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2016 02:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aSJys-0001d1-D8; Sun, 07 Feb 2016 02:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Welsh Duggan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Sun, 07 Feb 2016 07:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21462 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 21462-submit@debbugs.gnu.org id=B21462.14548308636182 (code B ref 21462); Sun, 07 Feb 2016 07:42:02 +0000 Original-Received: (at 21462) by debbugs.gnu.org; 7 Feb 2016 07:41:03 +0000 Original-Received: from localhost ([127.0.0.1]:36437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSJxr-0001ao-Et for submit@debbugs.gnu.org; Sun, 07 Feb 2016 02:41:03 -0500 Original-Received: from md5i.com ([75.151.244.229]:42936) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aSJxm-0001ab-4x for 21462@debbugs.gnu.org; Sun, 07 Feb 2016 02:40:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From; bh=CijGmHeuyEGkl2yhdOlOE+njRQQQFeBNPxr5KYpulJ8=; b=OAeEwT Lcb3b3UeBupGGlvlvI9+xn/33s+5F+dvXT0tYZKNeMJORtnFsbkOXjA0h6vGR4x5LIUPtjZ63A1go sgeCxnl1ood5GSZXMqH8rd47Qy00zDTthaIpPaHGnp3hq; Original-Received: from md5i by md5i.com with local (Exim 4.86) (envelope-from ) id 1aSJxg-0006oc-AR; Sun, 07 Feb 2016 02:40:48 -0500 In-Reply-To: <87si15awxh.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 07 Feb 2016 16:53:14 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112614 Archived-At: Lars Ingebrigtsen writes: > Michael Welsh Duggan writes: > >> I have been attempting to implement the following use case: >> >> I have a gnus group that receives messages with subjects that look sort >> of like this: >> >> Some title, part 1, by X >> Some title, part 2, by X >> Some other title, part 32, by Y >> >> I gather these into threads by title using my own simplification >> function which I add to `gnus-simplify-subject-functions' in this >> group. I also set `gnus-thread-hide-subtree' to `t' in this group, so >> each title takes up one Summary line. >> >> I then want to sort these threads by the *latest* message in the >> thread. Thus, when a new part is received, the entire thread shows up >> as "newer". To do this, I created by own function to set >> `gnus-thread-sort-functions' to. This looks like this: >> >> (defun md5i-thread-sort-by-most-recent-date-reverse (h1 h2) >> (<= (gnus-thread-latest-date h1) (gnus-thread-latest-date h2))) >> >> Unfortunately, this fails in many cases due to the fact that >> `gnus-summary-prepare' gathers thread after sorting threads. In my case >> I need the reverse, and I think that the reverse always makes sense. I >> have a patch which does this, and has been working for me for half a >> year or so. I suggest you add this or an equivalent change to Gnus. >> Feel free to rewrite this patch completely. I wrote it long enough ago >> that I do not remember why I needed to create `gnus-make-threaded-sort'. > > There is a separater `gnus-sort-gathered-threads-function' -- doesn't it > do what you want it to? I don't think so. At least not according to how I understand the documentation and how I read the sources. gnus-sort-gathered-threads looks like it sorts the articles _within_ a gathered thread. The process is: >From gnus-summary-prepare: 1) gnus-make-threads -> gathers articles into threads by ref 2) gnus-cut-threads -> removes "uninteresting" articles from the threads 3) gnus-sort-threads -> sorts the threads (with respect to each other thread) 4) gnus-summary-thread-gathering-function -> gathers threads with similar characteristics (subject, reference) into a single thread 5) gnus-sort-gathered-threads -> sorts the articles within each thread My argument is that steps 3 and 4 are backwards. Step 4 is the place where the final thread groupings are decided, and sorting these threads with respect to each other should happen afterward. -- Michael Welsh Duggan (md5i@md5i.com)