[gnus git] branch master updated: m0-7-180-g1f1ec45 =1= Add option to sort threads non-recursively.

Tassilo Horn <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  1f1ec450cdb60da66be47d372d6ace2fdd070ce2 (commit)
      from  1567c06c6b93c06ac88292b0c7697a346cfda82e (commit)


- Log -----------------------------------------------------------------
commit 1f1ec450cdb60da66be47d372d6ace2fdd070ce2
Author: Tassilo Horn <[email protected]>
Date:   Fri Jul 26 15:38:08 2013 +0200

    Add option to sort threads non-recursively.
    
    * gnus-sum.el (gnus-sort-threads-recursively): New defcustom.
    (gnus-sort-threads): Use it.
    
    * gnus.texi (Sorting the Summary Buffer): Document new defcustom
    `gnus-sort-threads-recursively'.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a0b98be..ed8363e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-26  Tassilo Horn  <[email protected]>
+
+	* gnus-sum.el (gnus-sort-threads-recursively): New defcustom.
+	(gnus-sort-threads): Use it.
+
 2013-07-25  Andreas Schwab  <[email protected]>
 
 	* gnus-art.el (gnus-button-url-regexp): Make it match url in which
diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index f3918b0..15cbb5a 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/gnus-sum.el
@@ -847,6 +847,13 @@ controls how articles are sorted."
                           (function :tag "other"))
                   (boolean :tag "Reverse order"))))
 
+(defcustom gnus-sort-threads-recursively t
+  "If non-nil, `gnus-thread-sort-functions' are applied recursively.
+Setting this to nil allows sorting high-score, recent,
+etc. threads to the top of the summary buffer while still
+retaining chronological old to new sorting order inside threads."
+  :group 'gnus-summary-sort
+  :type 'boolean)
 
 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number)
   "*List of functions used for sorting threads in the summary buffer.
@@ -4876,9 +4883,11 @@ If LINE, insert the rebuilt thread starting on line LINE."
     (gnus-message 8 "Sorting threads...")
     (prog1
 	(condition-case nil
-	    (let ((max-lisp-eval-depth (max max-lisp-eval-depth 5000)))
-	      (gnus-sort-threads-recursive
-	       threads (gnus-make-sort-function gnus-thread-sort-functions)))
+	    (let ((max-lisp-eval-depth (max max-lisp-eval-depth 5000))
+		  (sort-func (gnus-make-sort-function gnus-thread-sort-functions)))
+	      (if gnus-sort-threads-recursively
+		  (gnus-sort-threads-recursive threads sort-func)
+		(sort threads sort-func)))
 	  ;; Even after binding max-lisp-eval-depth, the recursive
 	  ;; sorter might fail for very long threads.  In that case,
 	  ;; try using a (less well-tested) non-recursive sorter.
diff --git a/texi/ChangeLog b/texi/ChangeLog
index 25c0ec8..017d211 100644
--- a/texi/ChangeLog
+++ b/texi/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-26  Tassilo Horn  <[email protected]>
+
+	* gnus.texi (Sorting the Summary Buffer): Document new defcustom
+	`gnus-sort-threads-recursively'.
+
 2013-07-19  Geoff Kuenning  <[email protected]>  (tiny change)
 
 	* gnus.texi (Customizing Articles): Document function predicates.
diff --git a/texi/gnus.texi b/texi/gnus.texi
index 85e9f95..2c399ff 100644
--- a/texi/gnus.texi
+++ b/texi/gnus.texi
@@ -7394,6 +7394,11 @@ say something like:
         gnus-thread-sort-by-score))
 @end lisp
 
+By default, threads are sorted recursively, that is, first the roots,
+then all subthreads, and so on.  If you feel more like sorting only
+the roots, so that inside a thread the original chronological order is
+retained, you can set @code{gnus-sort-threads-recursively} to nil.
+
 @vindex gnus-thread-score-function
 The function in the @code{gnus-thread-score-function} variable (default
 @code{+}) is used for calculating the total score of a thread.  Useful

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog   |    5 +++++
 lisp/gnus-sum.el |   15 ++++++++++++---
 texi/ChangeLog   |    5 +++++
 texi/gnus.texi   |    5 +++++
 4 files changed, 27 insertions(+), 3 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.