aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorTassilo Horn2013-07-26 22:24:33 +0000
committerKatsumi Yamaoka2013-07-26 22:24:33 +0000
commit13afd560a137730c2fd22b9ee664867f9d4e17d6 (patch)
tree4ea749016187fe0eeb6eae41d36c33fb59230e26 /lisp
parentfec9206062b420aca84f53d05a72c3ee43244022 (diff)
downloademacs-13afd560a137730c2fd22b9ee664867f9d4e17d6.tar.gz
emacs-13afd560a137730c2fd22b9ee664867f9d4e17d6.zip
Gnus: 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'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-sum.el15
2 files changed, 17 insertions, 3 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index a67c55947ac..c32853a2a9f 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12013-07-26 Tassilo Horn <tsdh@gnu.org>
2
3 * gnus-sum.el (gnus-sort-threads-recursively): New defcustom.
4 (gnus-sort-threads): Use it.
5
12013-07-25 Andreas Schwab <schwab@linux-m68k.org> 62013-07-25 Andreas Schwab <schwab@linux-m68k.org>
2 7
3 * gnus-art.el (gnus-button-url-regexp): Make it match url in which 8 * gnus-art.el (gnus-button-url-regexp): Make it match url in which
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index f3918b0a215..15cbb5a45e6 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -847,6 +847,13 @@ controls how articles are sorted."
847 (function :tag "other")) 847 (function :tag "other"))
848 (boolean :tag "Reverse order")))) 848 (boolean :tag "Reverse order"))))
849 849
850(defcustom gnus-sort-threads-recursively t
851 "If non-nil, `gnus-thread-sort-functions' are applied recursively.
852Setting this to nil allows sorting high-score, recent,
853etc. threads to the top of the summary buffer while still
854retaining chronological old to new sorting order inside threads."
855 :group 'gnus-summary-sort
856 :type 'boolean)
850 857
851(defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number) 858(defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number)
852 "*List of functions used for sorting threads in the summary buffer. 859 "*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."
4876 (gnus-message 8 "Sorting threads...") 4883 (gnus-message 8 "Sorting threads...")
4877 (prog1 4884 (prog1
4878 (condition-case nil 4885 (condition-case nil
4879 (let ((max-lisp-eval-depth (max max-lisp-eval-depth 5000))) 4886 (let ((max-lisp-eval-depth (max max-lisp-eval-depth 5000))
4880 (gnus-sort-threads-recursive 4887 (sort-func (gnus-make-sort-function gnus-thread-sort-functions)))
4881 threads (gnus-make-sort-function gnus-thread-sort-functions))) 4888 (if gnus-sort-threads-recursively
4889 (gnus-sort-threads-recursive threads sort-func)
4890 (sort threads sort-func)))
4882 ;; Even after binding max-lisp-eval-depth, the recursive 4891 ;; Even after binding max-lisp-eval-depth, the recursive
4883 ;; sorter might fail for very long threads. In that case, 4892 ;; sorter might fail for very long threads. In that case,
4884 ;; try using a (less well-tested) non-recursive sorter. 4893 ;; try using a (less well-tested) non-recursive sorter.