GNU bug report logs - #30356
[PATCH] Add below option to gnus-summary-limit-to-score

Previous Next

Package: emacs;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Mon, 5 Feb 2018 12:52:01 UTC

Severity: wishlist

Tags: fixed, patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30356 in the body.
You can then email your comments to 30356 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Mon, 05 Feb 2018 12:52:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oleg Pykhalov <go.wigust <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 05 Feb 2018 12:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Mon,  5 Feb 2018 15:50:42 +0300
* 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.
 
 * 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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Mon, 05 Feb 2018 12:59:01 GMT) Full text and rfc822 format available.

Message #8 received at 30356 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 30356 <at> debbugs.gnu.org
Subject: Re: bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Mon, 05 Feb 2018 13:58:16 +0100
On Feb 05 2018, Oleg Pykhalov <go.wigust <at> 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 <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Mon, 05 Feb 2018 13:34:01 GMT) Full text and rfc822 format available.

Message #11 received at 30356 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Andreas Schwab <schwab <at> suse.de>,
	30356 <at> debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust <at> gmail.com>
Subject: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Mon,  5 Feb 2018 16:31:43 +0300
* 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.
 
 * 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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Tue, 06 Feb 2018 04:35:02 GMT) Full text and rfc822 format available.

Message #14 received at 30356 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Andreas Schwab <schwab <at> suse.de>
Cc: 30356 <at> debbugs.gnu.org
Subject: Re: bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Tue, 06 Feb 2018 07:34:43 +0300
[Message part 1 (text/plain, inline)]
In addition to myself:

Oleg Pykhalov <go.wigust <at> 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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Wed, 11 Apr 2018 20:58:01 GMT) Full text and rfc822 format available.

Message #17 received at 30356 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: Andreas Schwab <schwab <at> suse.de>, 30356 <at> debbugs.gnu.org
Subject: Re: bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Wed, 11 Apr 2018 22:57:39 +0200
Oleg Pykhalov <go.wigust <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Thu, 12 Apr 2018 18:30:02 GMT) Full text and rfc822 format available.

Message #20 received at 30356 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Andreas Schwab <schwab <at> suse.de>, 30356 <at> debbugs.gnu.org
Subject: Re: bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Thu, 12 Apr 2018 21:28:47 +0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Oleg Pykhalov <go.wigust <at> 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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Thu, 12 Apr 2018 18:53:01 GMT) Full text and rfc822 format available.

Message #23 received at 30356 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: Andreas Schwab <schwab <at> suse.de>, 30356 <at> debbugs.gnu.org
Subject: Re: bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Thu, 12 Apr 2018 20:52:19 +0200
Oleg Pykhalov <go.wigust <at> gmail.com> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Oleg Pykhalov <go.wigust <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Thu, 12 Apr 2018 19:06:02 GMT) Full text and rfc822 format available.

Message #26 received at 30356 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: go.wigust <at> gmail.com, 30356 <at> debbugs.gnu.org, schwab <at> suse.de
Subject: Re: bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Thu, 12 Apr 2018 22:05:38 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Thu, 12 Apr 2018 20:52:19 +0200
> Cc: Andreas Schwab <schwab <at> suse.de>, 30356 <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Thu, 12 Apr 2018 19:17:01 GMT) Full text and rfc822 format available.

Message #29 received at 30356 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: go.wigust <at> gmail.com, 30356 <at> debbugs.gnu.org, schwab <at> suse.de
Subject: Re: bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Thu, 12 Apr 2018 21:16:09 +0200
Eli Zaretskii <eliz <at> 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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 12 Apr 2018 19:20:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 30356 <at> debbugs.gnu.org and Oleg Pykhalov <go.wigust <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 12 Apr 2018 19:20:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30356; Package emacs. (Thu, 12 Apr 2018 19:25:01 GMT) Full text and rfc822 format available.

Message #36 received at 30356 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Andreas Schwab <schwab <at> suse.de>, 30356 <at> debbugs.gnu.org
Subject: Re: bug#30356: [PATCH] Add below option to gnus-summary-limit-to-score
Date: Thu, 12 Apr 2018 22:23:57 +0300
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Oleg Pykhalov <go.wigust <at> gmail.com> writes:
>
>> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>>
>>> Oleg Pykhalov <go.wigust <at> 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.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 11 May 2018 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.