From: "Jakub Ječmínek" <jecminek.k@gmail.com>
To: 61002@debbugs.gnu.org
Cc: "Lars Ingebrigtsen" <larsi@gnus.org>,
"Kamil Jońca" <kjonca@poczta.onet.pl>
Subject: bug#61002: [PATCH] Re: bug#61002: 28.2; Gnus - "Date" scoring scores all articles.
Date: Sat, 20 Jan 2024 01:14:42 +0100 [thread overview]
Message-ID: <m2a5p0svwt.fsf@gmail.com> (raw)
In-Reply-To: <878rhvhsyu.fsf@alfa.kjonca> ("Kamil Jońca"'s message of "Sun, 22 Jan 2023 09:30:17 +0100")
Tags: patch
Kamil Jońca <kjonca@poczta.onet.pl> writes:
> (I do not know if emacs list is the best one. If gnus have dedicated
> list please tell me)
>
> I have to resubscribe some of my groups.
> As I know that most of articles I have read already, I wanted to score
> them lower before first of January. But it seems that always all
> articles are marked as scored:
> key sequence
>
> C-u
> 1
> L
> d
> b
> t
> Tue, 16 Jul 2019 09:20:31 +0000 (UTC)
>
> All articles are marked as scored.
> I would expect that only these before 16 jul 2019 will be marked.
Hi, thanks for the bug report! Maybe I'm missing something but it feels
like Gnus is providing invalid default value for the match element as it
should be integer. I would like to ask somebody who is more
knowledgeable about Gnus to confirm my hypothesis. If so, I've prepared
a patch which provides more meaningful default value - number of days
between today and entry at point. Please see below.
From e0269f4aa369182fdc81231815b36a05190149ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Je=C4=8Dm=C3=ADnek?= <jecminek.k@gmail.com>
Date: Sat, 20 Jan 2024 00:51:03 +0100
Subject: [PATCH] Provide valid match element for date key during interactive
gnus-summary-increase-score
* lisp/gnus/gnus-score.el (gnus-summary-score-entry): The user is given invalid
default match element value during interactive use of gnus-summary-increase-score
and gnus-summary-lower-score (date key). We fix that by providing more meaningful
default value - number of days between today and entry at point.
---
lisp/gnus/gnus-score.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index bd19e7d7cd7..8199e94fd20 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -895,7 +895,11 @@ If optional argument `EXTRA' is non-nil, it's a non-standard overview header."
(if (< score 0) "lower" "raise"))
(if (numberp match)
(int-to-string match)
- match))))
+ (int-to-string
+ (-
+ (mod 86400 (car (time-convert (current-time) 1)))
+ (mod 86400 (car (time-convert (gnus-date-get-time
+ (gnus-date-iso8601 match)))))))))))
;; If this is an integer comparison, we transform from string to int.
(if (eq (nth 2 (assoc header gnus-header-index)) 'gnus-score-integer)
--
2.39.3 (Apple Git-145)
I'm happy to make further changes if need be and sign the paperwork.
Best,
Jakub Ječmínek
next prev parent reply other threads:[~2024-01-20 0:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-22 8:30 bug#61002: 28.2; Gnus - "Date" scoring scores all articles Kamil Jońca
2024-01-20 0:14 ` Jakub Ječmínek [this message]
2024-01-20 11:33 ` Jakub Ječmínek
2024-01-27 9:30 ` Eli Zaretskii
2024-02-10 8:07 ` Eli Zaretskii
2024-02-10 17:27 ` Eric Abrahamsen
2024-02-12 15:58 ` Jakub Ječmínek
2024-02-17 17:41 ` Eric Abrahamsen
2024-02-17 18:18 ` Philip Kaludercic
2024-02-17 18:23 ` Philip Kaludercic
2024-02-17 18:41 ` Eric Abrahamsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2a5p0svwt.fsf@gmail.com \
--to=jecminek.k@gmail.com \
--cc=61002@debbugs.gnu.org \
--cc=kjonca@poczta.onet.pl \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).