GNU bug report logs - #70134
[PATCH] Show all date options when adding Gnus scores interactively

Previous Next

Package: emacs;

Reported by: Jakub Ječmínek <kuba <at> kubajecminek.cz>

Date: Mon, 1 Apr 2024 21:45:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 70134 AT debbugs.gnu.org.

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#70134; Package emacs. (Mon, 01 Apr 2024 21:45:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Ječmínek <kuba <at> kubajecminek.cz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 01 Apr 2024 21:45:02 GMT) Full text and rfc822 format available.

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

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: bug-gnu-emacs <at> gnu.org
Cc: Eric Abrahamsen <eric <at> ericabrahamsen.net>, larsi <at> gnus.org,
 Alex Bochannek <alex <at> bochannek.com>
Subject: [PATCH] Show all date options when adding Gnus scores interactively
Date: Mon, 01 Apr 2024 21:44:04 +0000
[Message part 1 (text/plain, inline)]
Tags: patch


Hello, I'm attaching a patch that enhances user experience when adding
Gnus scores interactively based on date header. This patch does multiple
things:

1. `char-to-type' variable is renamed to `char-to-types' and we allow it
to be mapped to multiple types. This is useful because date header
supports all these types for scoring - '<, '>, 'r, 'after, 'before, 'at
but only the last three were previously offered to the user when using
interactive scoring.

2. `gnus-summary-score-entry' now provides sensible defaults for each
date scoring type - if we're scoring based on integer value ('<, '>) we
offer number of days between now and entry at point (revised version of
what was introduced in bug#61002) and if we're scoring based on string
value ('after, 'before, 'at, 'r) we provide valid date string.

3. If the user scores articles based on date strings ('before, 'after,
'at, 'r), `gnus-summary-score-entry' will no longer cast the type to the
integer type.

4. `gnus-score-date' catches 'r type as well.

I'm also Cc'ing Alex who was the original author of '< '> date scoring
types. Please let me know what you think.


In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.33, cairo version 1.16.0) of 2024-03-23 built on
 kuba-ThinkPad-T14-Gen-3
Repository revision: 7e32e8392ab77f9df08a1f11831cbba2242d721f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12201001
System Description: Ubuntu 22.04.4 LTS

[0001-Show-all-date-options-when-adding-Gnus-scores-interactively.patch (text/patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70134; Package emacs. (Sat, 13 Apr 2024 07:59:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: eric <at> ericabrahamsen.net, Jakub Ječmínek
 <kuba <at> kubajecminek.cz>
Cc: 70134 <at> debbugs.gnu.org, larsi <at> gnus.org, alex <at> bochannek.com
Subject: Re: bug#70134: [PATCH] Show all date options when adding Gnus scores
 interactively
Date: Sat, 13 Apr 2024 10:58:37 +0300
Ping!  Eric, any comments?

> Cc: Eric Abrahamsen <eric <at> ericabrahamsen.net>, larsi <at> gnus.org,
>  Alex Bochannek <alex <at> bochannek.com>
> Date: Mon, 01 Apr 2024 21:44:04 +0000
> From:  Jakub Ječmínek via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Hello, I'm attaching a patch that enhances user experience when adding
> Gnus scores interactively based on date header. This patch does multiple
> things:
> 
> 1. `char-to-type' variable is renamed to `char-to-types' and we allow it
> to be mapped to multiple types. This is useful because date header
> supports all these types for scoring - '<, '>, 'r, 'after, 'before, 'at
> but only the last three were previously offered to the user when using
> interactive scoring.
> 
> 2. `gnus-summary-score-entry' now provides sensible defaults for each
> date scoring type - if we're scoring based on integer value ('<, '>) we
> offer number of days between now and entry at point (revised version of
> what was introduced in bug#61002) and if we're scoring based on string
> value ('after, 'before, 'at, 'r) we provide valid date string.
> 
> 3. If the user scores articles based on date strings ('before, 'after,
> 'at, 'r), `gnus-summary-score-entry' will no longer cast the type to the
> integer type.
> 
> 4. `gnus-score-date' catches 'r type as well.
> 
> I'm also Cc'ing Alex who was the original author of '< '> date scoring
> types. Please let me know what you think.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70134; Package emacs. (Mon, 22 Apr 2024 03:34:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 70134 <at> debbugs.gnu.org,
 Jakub Ječmínek <kuba <at> kubajecminek.cz>, larsi <at> gnus.org,
 alex <at> bochannek.com
Subject: Re: bug#70134: [PATCH] Show all date options when adding Gnus
 scores interactively
Date: Sun, 21 Apr 2024 20:33:00 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> Ping!  Eric, any comments?

I have no comments! I don't know the scoring code, and fifteen minutes
of looking at the patch and its surroundings has left me none the wiser.
I don't know what it means to add multiple types to each char; I don't
know what a "type" is in this context. Jakub, do you think you could
enlighten me within a short paragraph or so? I'm also okay with just
chucking it in, and letting people in gnus.general know that things have
changed. There are a few hardcore scoring users there.

Thanks,
Eric




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70134; Package emacs. (Wed, 24 Apr 2024 22:53:08 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 70134 <at> debbugs.gnu.org, kuba <at> kubajecminek.cz, eliz <at> gnu.org, larsi <at> gnus.org,
 alex <at> bochannek.com
Subject: Re: bug#70134: [PATCH] Show all date options when adding Gnus scores
 interactively
Date: Wed, 24 Apr 2024 18:52:04 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I have no comments! I don't know the scoring code, and fifteen minutes
  > of looking at the patch and its surroundings has left me none the wiser.

This suggests to me that that code may need better comments to explain
its overall structure.  Do you think so?

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70134; Package emacs. (Wed, 24 Apr 2024 23:10:04 GMT) Full text and rfc822 format available.

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

From: Alex Bochannek <alex <at> bochannek.com>
To: Richard Stallman <rms <at> gnu.org>
Cc: Eric Abrahamsen <eric <at> ericabrahamsen.net>, 70134 <at> debbugs.gnu.org,
 eliz <at> gnu.org, larsi <at> gnus.org, kuba <at> kubajecminek.cz
Subject: Re: bug#70134: [PATCH] Show all date options when adding Gnus
 scores interactively
Date: Wed, 24 Apr 2024 16:08:37 -0700
Richard Stallman <rms <at> gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>   > I have no comments! I don't know the scoring code, and fifteen minutes
>   > of looking at the patch and its surroundings has left me none the wiser.
>
> This suggests to me that that code may need better comments to explain
> its overall structure.  Do you think so?

As Jakub mentioned, I am the author of that part of the Gnus scoring
code. I have not had a chance to look at the proposed patch, but I agree
that some explanations would be useful. I can look it over this weekend.

-- 
Alex.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70134; Package emacs. (Wed, 01 May 2024 19:29:02 GMT) Full text and rfc822 format available.

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

From: Jakub Ječmínek <kuba <at> kubajecminek.cz>
To: Alex Bochannek <alex <at> bochannek.com>
Cc: Eric Abrahamsen <eric <at> ericabrahamsen.net>, 70134 <at> debbugs.gnu.org,
 eliz <at> gnu.org, larsi <at> gnus.org, Richard Stallman <rms <at> gnu.org>
Subject: Re: bug#70134: [PATCH] Show all date options when adding Gnus scores
 interactively
Date: Wed, 01 May 2024 19:27:44 +0000
"Eric Abrahamsen" <eric <at> ericabrahamsen.net> writes:
> I have no comments! I don't know the scoring code, and fifteen minutes
> of looking at the patch and its surroundings has left me none the wiser.
> I don't know what it means to add multiple types to each char; I don't
> know what a "type" is in this context. Jakub, do you think you could
> enlighten me within a short paragraph or so? I'm also okay with just
> chucking it in, and letting people in gnus.general know that things have
> changed. There are a few hardcore scoring users there.

Sure, please let me know if need more context.

If you hit 'I' or 'L' on any article (in the Summary buffer) then Gnus
will walk you through the scoring process. Gnus first asks you which
header you're scoring on and presents you a bunch of characters (each
character represents one header: d - date, b - body, etc.). If you
choose date, for example, then Gnus asks you for 'match type' which is
basically a handler which will decide whether to lower/increase the
score. Which scoring types are presented depends on which header you're
scoring on but current implementation allows to bind only one character
to one type. But since Alex implemented integer scoring (currently bound
to `number' type) to date, I think we should extend it and present this
option to the user.


"Alex Bochannek" <alex <at> bochannek.com> writes:
> As Jakub mentioned, I am the author of that part of the Gnus scoring
> code. I have not had a chance to look at the proposed patch, but I agree
> that some explanations would be useful. I can look it over this weekend.

Thank you, your review is appreciated. Please do you happen to remember
why you used this form

(string= "date" (nth 0 (assoc header gnus-header-index)))

instead of this

(string= header "date")


Thanks!

Best

-- 
Kuba Ječmínek (http://kubajecminek.cz)





This bug report was last modified 2 days ago.

Previous Next


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