unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
@ 2018-02-05 12:50 Oleg Pykhalov
  2018-02-05 12:58 ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Oleg Pykhalov @ 2018-02-05 12:50 UTC (permalink / raw)
  To: 30356; +Cc: Oleg Pykhalov

* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-score): Add below
  option.
---
 doc/misc/gnus.texi    |  3 ++-
 etc/NEWS              |  5 +++++
 lisp/gnus/gnus-sum.el | 20 +++++++++++++-------
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 8c2fc56dd6..27baf6b11c 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -6663,7 +6663,8 @@ Limiting
 @kindex / v (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 (Summary)
diff --git a/etc/NEWS b/etc/NEWS
index 8fed15af5b..33b5073ad3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -106,6 +106,11 @@ non-text modes.
 \f
 * Changes in Specialized Modes and Packages in Emacs 27.1
 
+** 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 b6e9ea91b6..00aefa1d19 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -8559,14 +8559,20 @@ gnus-summary-limit-to-marks
 	(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: ")
-  (let ((data gnus-newsgroup-data)
-	articles)
+(defun gnus-summary-limit-to-score (score &optional below)
+  "Limit to articles with score at or above SCORE if BELOW is nil,
+below otherwise."
+  (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)
+         (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
-- 
2.15.1






^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
  2018-02-05 12:50 bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score Oleg Pykhalov
@ 2018-02-05 12:58 ` Andreas Schwab
  2018-02-05 13:31   ` Oleg Pykhalov
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2018-02-05 12:58 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: 30356

On Feb 05 2018, Oleg Pykhalov <go.wigust@gmail.com> wrote:

> +(defun gnus-summary-limit-to-score (score &optional below)
> +  "Limit to articles with score at or above SCORE if BELOW is nil,
> +below otherwise."

First line should be a full sentence.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
  2018-02-05 12:58 ` Andreas Schwab
@ 2018-02-05 13:31   ` Oleg Pykhalov
  2018-02-06  4:34     ` Oleg Pykhalov
  2018-04-11 20:57     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 10+ messages in thread
From: Oleg Pykhalov @ 2018-02-05 13:31 UTC (permalink / raw)
  To: Andreas Schwab, 30356; +Cc: Oleg Pykhalov

* lisp/gnus/gnus-sum.el (gnus-summary-limit-to-score): Add below
  option.
---
 doc/misc/gnus.texi    |  3 ++-
 etc/NEWS              |  5 +++++
 lisp/gnus/gnus-sum.el | 22 +++++++++++++++-------
 3 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 8c2fc56dd6..27baf6b11c 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -6663,7 +6663,8 @@ Limiting
 @kindex / v (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 (Summary)
diff --git a/etc/NEWS b/etc/NEWS
index 8fed15af5b..33b5073ad3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -106,6 +106,11 @@ non-text modes.
 \f
 * Changes in Specialized Modes and Packages in Emacs 27.1
 
+** 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 b6e9ea91b6..b9996e7d93 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -8559,14 +8559,22 @@ gnus-summary-limit-to-marks
 	(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: ")
-  (let ((data gnus-newsgroup-data)
-	articles)
+(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)
+         (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
-- 
2.15.1






^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
  2018-02-05 13:31   ` Oleg Pykhalov
@ 2018-02-06  4:34     ` Oleg Pykhalov
  2018-04-11 20:57     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 10+ messages in thread
From: Oleg Pykhalov @ 2018-02-06  4:34 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 30356

[-- Attachment #1: Type: text/plain, Size: 343 bytes --]

In addition to myself:

Oleg Pykhalov <go.wigust@gmail.com> writes:

  > +  (let* ((data gnus-newsgroup-data)
  > +         (compare (if (or below current-prefix-arg) #'<= #'>=))
  > +         articles)

“let*” can be reverted to “let” (as was before patch).  Let me know if a
new patch is needed for this.

Thanks,
Oleg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
  2018-02-05 13:31   ` Oleg Pykhalov
  2018-02-06  4:34     ` Oleg Pykhalov
@ 2018-04-11 20:57     ` Lars Ingebrigtsen
  2018-04-12 18:28       ` Oleg Pykhalov
  1 sibling, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-11 20:57 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: Andreas Schwab, 30356

Oleg Pykhalov <go.wigust@gmail.com> writes:

> * lisp/gnus/gnus-sum.el (gnus-summary-limit-to-score): Add below
>   option.

Looks good to me.  Do you have copyright assignment papers for the FSF
on file?  I had a peek in the copyright.list file but didn't see you
there...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
  2018-04-11 20:57     ` Lars Ingebrigtsen
@ 2018-04-12 18:28       ` Oleg Pykhalov
  2018-04-12 18:52         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Oleg Pykhalov @ 2018-04-12 18:28 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Andreas Schwab, 30356

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Oleg Pykhalov <go.wigust@gmail.com> writes:
>
>> * lisp/gnus/gnus-sum.el (gnus-summary-limit-to-score): Add below
>>   option.
>
> Do you have copyright assignment papers for the FSF on file?

Yes.  Should I send a copy to you?

Oleg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
  2018-04-12 18:28       ` Oleg Pykhalov
@ 2018-04-12 18:52         ` Lars Ingebrigtsen
  2018-04-12 19:05           ` Eli Zaretskii
  2018-04-12 19:23           ` Oleg Pykhalov
  0 siblings, 2 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-12 18:52 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: Andreas Schwab, 30356

Oleg Pykhalov <go.wigust@gmail.com> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Oleg Pykhalov <go.wigust@gmail.com> writes:
>>
>>> * lisp/gnus/gnus-sum.el (gnus-summary-limit-to-score): Add below
>>>   option.
>>
>> Do you have copyright assignment papers for the FSF on file?
>
> Yes.  Should I send a copy to you?

I couldn't find you in the copyright.list file on the FSF machines.  Are
you listed under a pseudonym there?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
  2018-04-12 18:52         ` Lars Ingebrigtsen
@ 2018-04-12 19:05           ` Eli Zaretskii
  2018-04-12 19:16             ` Lars Ingebrigtsen
  2018-04-12 19:23           ` Oleg Pykhalov
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2018-04-12 19:05 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: go.wigust, 30356, schwab

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Thu, 12 Apr 2018 20:52:19 +0200
> Cc: Andreas Schwab <schwab@suse.de>, 30356@debbugs.gnu.org
> 
> >> Do you have copyright assignment papers for the FSF on file?
> >
> > Yes.  Should I send a copy to you?
> 
> I couldn't find you in the copyright.list file on the FSF machines.  Are
> you listed under a pseudonym there?

Could be some FSF snafu, because I have an email from the FSF
copyright clerk from Oct 30, 2017 saying Oleg's assignment process is
complete.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
  2018-04-12 19:05           ` Eli Zaretskii
@ 2018-04-12 19:16             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-12 19:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: go.wigust, 30356, schwab

Eli Zaretskii <eliz@gnu.org> writes:

> Could be some FSF snafu, because I have an email from the FSF
> copyright clerk from Oct 30, 2017 saying Oleg's assignment process is
> complete.

Thanks, Eli.

I'll apply the patch to Emacs 27.1, Oleg.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
  2018-04-12 18:52         ` Lars Ingebrigtsen
  2018-04-12 19:05           ` Eli Zaretskii
@ 2018-04-12 19:23           ` Oleg Pykhalov
  1 sibling, 0 replies; 10+ messages in thread
From: Oleg Pykhalov @ 2018-04-12 19:23 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Andreas Schwab, 30356

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Oleg Pykhalov <go.wigust@gmail.com> writes:
>
>> Lars Ingebrigtsen <larsi@gnus.org> writes:
>>
>>> Oleg Pykhalov <go.wigust@gmail.com> writes:
>>>
>>>> * lisp/gnus/gnus-sum.el (gnus-summary-limit-to-score): Add below
>>>>   option.
>>>
>>> Do you have copyright assignment papers for the FSF on file?
>>
>> Yes.  Should I send a copy to you?
>
> I couldn't find you in the copyright.list file on the FSF machines.  Are
> you listed under a pseudonym there?

Unfortunately I cannot access a ‘copyright.list’, can I?  I've signed
the paper as “Oleg Pykhalov” and mail address as in current message.

Oleg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-12 19:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-05 12:50 bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score Oleg Pykhalov
2018-02-05 12:58 ` Andreas Schwab
2018-02-05 13:31   ` Oleg Pykhalov
2018-02-06  4:34     ` Oleg Pykhalov
2018-04-11 20:57     ` Lars Ingebrigtsen
2018-04-12 18:28       ` Oleg Pykhalov
2018-04-12 18:52         ` Lars Ingebrigtsen
2018-04-12 19:05           ` Eli Zaretskii
2018-04-12 19:16             ` Lars Ingebrigtsen
2018-04-12 19:23           ` Oleg Pykhalov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).