GNU bug report logs - #18156
Thread sorting before loose threads are gathered

Previous Next

Packages: emacs, gnus;

Reported by: Michael Welsh Duggan <mwd <at> md5i.com>

Date: Thu, 31 Jul 2014 00:02:01 UTC

Severity: minor

Merged with 21462

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Welsh Duggan <mwd <at> md5i.com>
To: 18156 <at> debbugs.gnu.org
Subject: bug#18156: Thread sorting before loose threads are gathered
Date: Wed, 30 Jul 2014 20:00:59 -0400
[Message part 1 (text/plain, inline)]
Thread sorting happens before loose threads are gathered.  See the
definition of `gnus-summary-prepare'.  Threads are made, then cut, then
sorted, and then gathered.  I believe they should be made, cut,
gathered, and then sorted.  A consequence of the current order is that
using `gnus-thread-sort-by-most-recent-{number,date}' in the
`gnus-thread-sort-functions' will not pay attention to all messages in a
gathered thread.

I have verified that changing the order does the right thing, but some
functions that may be used in sorting do not know how to handle gathered
threads.  An example is `gnus-thread-latest-date' which will choke on
the string at the car of a gathered thread.  I made a change to
`gnus-thread-latest-date' so it understands gathered threads, but it may
make more sense to do this in the function(s) that call the sort
functions rather than testing that all sorting functions know how to
handle gathered threads.

I include the patch I was testing with.  It is only valid with respect
to the sorting functions I was working with, and as such isn't suitable
to commit in its current state.

[Message part 2 (text/x-patch, inline)]
diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index 61cf7ec..8295227 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/gnus-sum.el
@@ -4146,9 +4146,9 @@ If SELECT-ARTICLES, only select those articles from GROUP."
     (when gnus-newsgroup-headers
       (gnus-summary-prepare-threads
        (if gnus-show-threads
-	   (gnus-sort-gathered-threads
-	    (funcall gnus-summary-thread-gathering-function
-		     (gnus-sort-threads
+           (gnus-sort-threads
+            (gnus-sort-gathered-threads
+             (funcall gnus-summary-thread-gathering-function
 		      (gnus-cut-threads (gnus-make-threads)))))
 	 ;; Unthreaded display.
 	 (gnus-sort-articles gnus-newsgroup-headers))))
@@ -5109,7 +5109,8 @@ Unscored articles will be counted as having a score of zero."
 	 (mapcar (lambda (header) (gnus-float-time
 				   (gnus-date-get-time
 				    (mail-header-date header))))
-		 (message-flatten-list thread))))
+		 (let ((x (message-flatten-list thread)))
+                   (if (stringp (car x)) (cdr x) x)))))
 
 (defun gnus-thread-total-score-1 (root)
   ;; This function find the total score of the thread below ROOT.
[Message part 3 (text/plain, inline)]

Ma Gnus v0.8
GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, X toolkit)
 of 2014-07-13 on maru2
200 news.gmane.org InterNetNews NNRP server INN 2.5.1 ready (posting ok)
100 Legal commands
  ARTICLE [message-ID|number]
  AUTHINFO USER name|PASS password|GENERIC program [argument ...]
  BODY [message-ID|number]
  CAPABILITIES [keyword]
  DATE
  GROUP newsgroup
  HDR header [message-ID|range]
  HEAD [message-ID|number]
  HELP
  IHAVE message-ID
  LAST
  LIST [ACTIVE [wildmat]|ACTIVE.TIMES [wildmat]|DISTRIB.PATS|DISTRIBUTIONS|HEADERS [MSGID|RANGE]|MODERATORS|MOTD|NEWSGROUPS [wildmat]|OVERVIEW.FMT|SUBSCRIPTIONS]
  LISTGROUP [newsgroup [range]]
  MODE READER
  NEWGROUPS [yy]yymmdd hhmmss [GMT]
  NEWNEWS wildmat [yy]yymmdd hhmmss [GMT]
  NEXT
  OVER [range]
  POST
  QUIT
  STARTTLS
  STAT [message-ID|number]
  XGTITLE [wildmat]
  XHDR header [message-ID|range]
  XOVER [range]
  XPAT header message-ID|range pattern [pattern ...]
Report problems to <usenet <at> ger.gmane.org>.
.
382 Begin TLS negotiation now
100 Legal commands
  ARTICLE [message-ID|number]
  AUTHINFO USER name|PASS password|GENERIC program [argument ...]
  BODY [message-ID|number]
  CAPABILITIES [keyword]
  DATE
  GROUP newsgroup
  HDR header [message-ID|range]
  HEAD [message-ID|number]
  HELP
  IHAVE message-ID
  LAST
  LIST [ACTIVE [wildmat]|ACTIVE.TIMES [wildmat]|DISTRIB.PATS|DISTRIBUTIONS|HEADERS [MSGID|RANGE]|MODERATORS|MOTD|NEWSGROUPS [wildmat]|OVERVIEW.FMT|SUBSCRIPTIONS]
  LISTGROUP [newsgroup [range]]
  MODE READER
  NEWGROUPS [yy]yymmdd hhmmss [GMT]
  NEWNEWS wildmat [yy]yymmdd hhmmss [GMT]
  NEXT
  OVER [range]
  POST
  QUIT
  STARTTLS
  STAT [message-ID|number]
  XGTITLE [wildmat]
  XHDR header [message-ID|range]
  XOVER [range]
  XPAT header message-ID|range pattern [pattern ...]
Report problems to <usenet <at> ger.gmane.org>.
.

-- 
Michael Welsh Duggan
(md5i <at> md5i.com)

This bug report was last modified 8 years and 114 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.