]> git.eshelyaron.com Git - emacs.git/commitdiff
From: Lars Ingebrigtseb <larsi@gnus.org>
authorOleg Pykhalov <go.wigust@gmail.com>
Thu, 12 Apr 2018 19:19:23 +0000 (21:19 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 12 Apr 2018 19:19:23 +0000 (21:19 +0200)
* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-score): Allow limit
to articles that have a score below the stated number, too
(bug#30356).

doc/misc/gnus.texi
etc/NEWS
lisp/gnus/gnus-sum.el

index 1a2f6dd09f1e364ed0fb629aea277f6ed325616c..6c165424dd2f20641a6864b7e0f5b03ed474fbdd 100644 (file)
@@ -6672,7 +6672,8 @@ Limit the summary buffer to the unseen articles
 @kindex / v @r{(Summary)}
 @findex gnus-summary-limit-to-score
 Limit the summary buffer to articles that have a score at or above some
-score (@code{gnus-summary-limit-to-score}).
+score (@code{gnus-summary-limit-to-score}).  If given a prefix, below
+some score.
 
 @item / p
 @kindex / p @r{(Summary)}
index 47c77d1a830bf47bb232dffe2cb7d9760a5f18bf..2847384a3a6a76cb4cef0f41c418dc27656a7233 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -175,6 +175,11 @@ you don't need to set them in your early init file.
 
 *** New function 'package-activate-all'.
 
+** Gnus
+
+*** A prefix argument to 'gnus-summary-limit-to-score' will limit reverse
+Limit to articles with score at below.
+
 ** Ecomplete
 *** The ecomplete sorting has changed to a decay-based algorithm.
 This can be controlled by the new `ecomplete-sort-predicate' variable.
index cb262406617f34d2b67f55ce72d595190f28f6eb..e1789cdd5995d581bb8f391a20bed7ba04705e2d 100644 (file)
@@ -8563,14 +8563,22 @@ Returns how many articles were removed."
        (gnus-summary-limit articles))
     (gnus-summary-position-point)))
 
-(defun gnus-summary-limit-to-score (score)
-  "Limit to articles with score at or above SCORE."
-  (interactive "NLimit to articles with score of at least: ")
+(defun gnus-summary-limit-to-score (score &optional below)
+  "Limit to articles with score at or above SCORE.
+
+With a prefix argument, limit to articles with score at or below
+SCORE."
+  (interactive (list (string-to-number
+                      (read-string
+                       (format "Limit to articles with score of at %s: "
+                               (if current-prefix-arg "most" "least"))))))
   (let ((data gnus-newsgroup-data)
-       articles)
+        (compare (if (or below current-prefix-arg) #'<= #'>=))
+        articles)
     (while data
-      (when (>= (gnus-summary-article-score (gnus-data-number (car data)))
-               score)
+      (when (funcall compare (gnus-summary-article-score
+                              (gnus-data-number (car data)))
+                     score)
        (push (gnus-data-number (car data)) articles))
       (setq data (cdr data)))
     (prog1