diff options
| author | Tassilo Horn | 2013-07-26 22:24:33 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2013-07-26 22:24:33 +0000 |
| commit | 13afd560a137730c2fd22b9ee664867f9d4e17d6 (patch) | |
| tree | 4ea749016187fe0eeb6eae41d36c33fb59230e26 | |
| parent | fec9206062b420aca84f53d05a72c3ee43244022 (diff) | |
| download | emacs-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'.
| -rw-r--r-- | doc/misc/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/misc/gnus.texi | 5 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 15 |
4 files changed, 27 insertions, 3 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index da2491cb94a..50214bb364c 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-07-26 Tassilo Horn <tsdh@gnu.org> | ||
| 2 | |||
| 3 | * gnus.texi (Sorting the Summary Buffer): Document new defcustom | ||
| 4 | `gnus-sort-threads-recursively'. | ||
| 5 | |||
| 1 | 2013-07-25 Glenn Morris <rgm@gnu.org> | 6 | 2013-07-25 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * Makefile.in (INFO_TARGETS, DVI_TARGETS, PDF_TARGETS): Add ido. | 8 | * Makefile.in (INFO_TARGETS, DVI_TARGETS, PDF_TARGETS): Add ido. |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index be0425a679b..5f9e0b9db28 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -7394,6 +7394,11 @@ say something like: | |||
| 7394 | gnus-thread-sort-by-score)) | 7394 | gnus-thread-sort-by-score)) |
| 7395 | @end lisp | 7395 | @end lisp |
| 7396 | 7396 | ||
| 7397 | By default, threads are sorted recursively, that is, first the roots, | ||
| 7398 | then all subthreads, and so on. If you feel more like sorting only | ||
| 7399 | the roots, so that inside a thread the original chronological order is | ||
| 7400 | retained, you can set @code{gnus-sort-threads-recursively} to nil. | ||
| 7401 | |||
| 7397 | @vindex gnus-thread-score-function | 7402 | @vindex gnus-thread-score-function |
| 7398 | The function in the @code{gnus-thread-score-function} variable (default | 7403 | The function in the @code{gnus-thread-score-function} variable (default |
| 7399 | @code{+}) is used for calculating the total score of a thread. Useful | 7404 | @code{+}) is used for calculating the total score of a thread. Useful |
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 @@ | |||
| 1 | 2013-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 | |||
| 1 | 2013-07-25 Andreas Schwab <schwab@linux-m68k.org> | 6 | 2013-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. | ||
| 852 | Setting this to nil allows sorting high-score, recent, | ||
| 853 | etc. threads to the top of the summary buffer while still | ||
| 854 | retaining 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. |