From: Oleg Pykhalov Date: Thu, 12 Apr 2018 19:19:23 +0000 (+0200) Subject: From: Lars Ingebrigtseb X-Git-Tag: emacs-27.0.90~5277 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2892b4b99ca31771b16676d1893456310ae2abc4;p=emacs.git From: Lars Ingebrigtseb * 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). --- diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 1a2f6dd09f1..6c165424dd2 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -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)} diff --git a/etc/NEWS b/etc/NEWS index 47c77d1a830..2847384a3a6 100644 --- 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. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index cb262406617..e1789cdd599 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -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