emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] feature/gnus-select2 c87252e 15/32: New gnus summary sorti


From: Andrew G Cohen
Subject: [Emacs-diffs] feature/gnus-select2 c87252e 15/32: New gnus summary sorting functions on rsv
Date: Sun, 16 Dec 2018 06:54:03 -0500 (EST)

branch: feature/gnus-select2
commit c87252e8e93eea7e6141b4ebbb57f85c34e40742
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 5654d92..a136a8e 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -845,6 +845,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"))))
@@ -888,6 +889,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)
@@ -5028,6 +5030,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]