emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] feature/gnus-select cab358e: New gnus summary sorting func


From: Andrew G Cohen
Subject: [Emacs-diffs] feature/gnus-select cab358e: New gnus summary sorting functions on rsv
Date: Sat, 6 May 2017 04:13:50 -0400 (EDT)

branch: feature/gnus-select
commit cab358ed19ad433fedafb31c7af1e4ec70cad977
Author: Andrew G Cohen <address@hidden>
Commit: Andrew G Cohen <address@hidden>

    New gnus summary sorting functions on rsv
    
    * lisp/gnus/gnus-sum.el (gnus-article-sort-by-rsv):
    (gnus-thread-sort-by-rsv): New functions to allow sorting by rsv in
    nnselect groups.
---
 lisp/gnus/gnus-sum.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 29949cd..5a95273 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -844,6 +844,7 @@ controls how articles are sorted."
                           (function-item gnus-article-sort-by-subject)
                           (function-item gnus-article-sort-by-date)
                           (function-item gnus-article-sort-by-score)
+                          (function-item gnus-article-sort-by-rsv)
                           (function-item gnus-article-sort-by-random)
                           (function :tag "other"))
                   (boolean :tag "Reverse order"))))
@@ -887,6 +888,7 @@ subthreads, customize `gnus-subthread-sort-functions'."
                    (function-item gnus-thread-sort-by-subject)
                    (function-item gnus-thread-sort-by-date)
                    (function-item gnus-thread-sort-by-score)
+                   (function-item gnus-thread-sort-by-rsv)
                    (function-item gnus-thread-sort-by-most-recent-number)
                    (function-item gnus-thread-sort-by-most-recent-date)
                    (function-item gnus-thread-sort-by-random)
@@ -5026,6 +5028,17 @@ using some other form will lead to serious barfage."
   (gnus-article-sort-by-date
    (gnus-thread-header h1) (gnus-thread-header h2)))
 
+(defsubst gnus-article-sort-by-rsv (h1 h2)
+  "Sort articles by rsv."
+  (when gnus-newsgroup-selection
+    (< (nnselect-article-rsv (mail-header-number h1))
+       (nnselect-article-rsv (mail-header-number h2)))))
+
+(defun gnus-thread-sort-by-rsv (h1 h2)
+  "Sort threads by root article rsv."
+  (gnus-article-sort-by-rsv
+   (gnus-thread-header h1) (gnus-thread-header h2)))
+
 (defsubst gnus-article-sort-by-score (h1 h2)
   "Sort articles by root article score.
 Unscored articles will be counted as having a score of zero."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]