From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Newsgroups: gmane.emacs.bugs Subject: bug#61002: [PATCH] Re: bug#61002: 28.2; Gnus - "Date" scoring scores all articles. Date: Sat, 20 Jan 2024 01:14:42 +0100 Message-ID: References: <878rhvhsyu.fsf@alfa.kjonca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39645"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.1 Cc: Lars Ingebrigtsen , Kamil =?UTF-8?Q?Jo=C5=84ca?= To: 61002@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 20 01:15:54 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rQz1d-000A4I-RP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Jan 2024 01:15:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQz0m-0000xC-UI; Fri, 19 Jan 2024 19:15:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQz0l-0000wk-Ke for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2024 19:14:59 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQz0l-0002Ae-Cl for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2024 19:14:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rQz0n-0002cJ-Ou for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2024 19:15:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jan 2024 00:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61002 X-GNU-PR-Package: emacs Original-Received: via spool by 61002-submit@debbugs.gnu.org id=B61002.170570969510025 (code B ref 61002); Sat, 20 Jan 2024 00:15:01 +0000 Original-Received: (at 61002) by debbugs.gnu.org; 20 Jan 2024 00:14:55 +0000 Original-Received: from localhost ([127.0.0.1]:60478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQz0g-0002bd-S1 for submit@debbugs.gnu.org; Fri, 19 Jan 2024 19:14:55 -0500 Original-Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:61929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQz0e-0002bP-Jh for 61002@debbugs.gnu.org; Fri, 19 Jan 2024 19:14:53 -0500 Original-Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a2cea0563cbso205347666b.3 for <61002@debbugs.gnu.org>; Fri, 19 Jan 2024 16:14:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705709684; x=1706314484; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:cc :user-agent:references:in-reply-to:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=KSV01rFGPRDnmAaASmm5tPt8cBYj65yE6/+DUf9X/G4=; b=iPDi9Ej/hgRVXGOVF60IKYNEIPTTQv67j9ahUajve0oUuWlAHErl1IenXsEoN0B5mT nHG5lQC0ME8Q/6tWLUEHl0E7pMfh2aQKGXYM2Wh8ODJS0Gxep1WqWRHJk5fKvC8vJzUu kdVY26dV4yMMK7+1f/ohNLoHlj/mjEEGgqlWFUtgoVrlIFNCr19tYPXsk++lUdJXAP4u FSdV4gCPRJGCk3pzcm4CzH2UpNEgH5HxJ0Me2nLiMPhkWRDQesSPYbip0azaqBm+1AzF ONqRmA/7VPpI8NFXmxQi8PXbWKDpCzSOhWuJPUXS9+KOzpNJBXuCz2Fzc1HCCQfsr7vH 1Zaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705709684; x=1706314484; h=content-transfer-encoding:mime-version:message-id:date:cc :user-agent:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KSV01rFGPRDnmAaASmm5tPt8cBYj65yE6/+DUf9X/G4=; b=wkwzg0yOVR0FlZMXuCLHJ4VASoRP15/QMvYexMfWybEcBQ8HwcLlomQZGEHr0/fLZ9 OwShERckkLClKdqPyHSrFEklN3qWo7Uo1276RUL/XZIxCT5zJvhB+DojPMVv8hj2/1nK VG+BKLmKhe+j4FYTB/imFq28UcKVU9NtxGKybHk9eoPXJ0iBTLPRglvUSQsZGBnydUYO gOaKYWDP2KaJFXr8/zix3djhspgQH0bKYFrKInNPCwNHl8hulp6mgIgXLmY90dQb2HGN 4hOXldnkn5Wcs7PwXp8uUX0UO/hCWbpdBDSwkc1W7D7v9VYKeEJn7vSy0iv1jci1BMa3 cuow== X-Gm-Message-State: AOJu0Yyd2XQs7eqodVc3xw5BQtBttiGqIRNOR61eQ1IHr017v7RxkKRG mPMS+DJjuwBc2KhZbD4MdFIa+/0v+CO0oHQ3ttlk1bM5sd8d3ltY X-Google-Smtp-Source: AGHT+IGI2XLFt4MqEBrA2Mb8YIgvC477Lp962yMk1QA1EVe6AgRR4yy4+93cHF6HlolTE8YiyrcsjA== X-Received: by 2002:a17:906:d157:b0:a23:6c6a:41a5 with SMTP id br23-20020a170906d15700b00a236c6a41a5mr297192ejb.45.1705709683537; Fri, 19 Jan 2024 16:14:43 -0800 (PST) Original-Received: from Jakubs-MacBook-Air.local (ip-217-030-066-058.aim-net.cz. [217.30.66.58]) by smtp.gmail.com with ESMTPSA id f1-20020a170906c08100b00a28fdd21763sm10877904ejz.134.2024.01.19.16.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 16:14:43 -0800 (PST) In-Reply-To: <878rhvhsyu.fsf@alfa.kjonca> ("Kamil =?UTF-8?Q?Jo=C5=84ca?="'s message of "Sun, 22 Jan 2023 09:30:17 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278550 Archived-At: Tags: patch Kamil Jo=C5=84ca 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: =3D?UTF-8?q?Jakub=3D20Je=3DC4=3D8Dm=3DC3=3DADnek?=3D 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 inv= alid 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 mean= ingful 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-st= andard 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 m= atch))))))))))) ;; 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=C4=8Dm=C3=ADnek