From unknown Sun Aug 17 01:46:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#58820 <58820@debbugs.gnu.org> To: bug#58820 <58820@debbugs.gnu.org> Subject: Status: [PATCH] Calculate age cutoff at n-th midnight instead of n*24h mark Reply-To: bug#58820 <58820@debbugs.gnu.org> Date: Sun, 17 Aug 2025 08:46:03 +0000 retitle 58820 [PATCH] Calculate age cutoff at n-th midnight instead of n*24= h mark reassign 58820 emacs submitter 58820 =C5=81ukasz Stelmach severity 58820 wishlist tag 58820 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 14:57:30 2022 Received: (at submit) by debbugs.gnu.org; 27 Oct 2022 18:57:30 +0000 Received: from localhost ([127.0.0.1]:59323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo84H-0005pl-Nv for submit@debbugs.gnu.org; Thu, 27 Oct 2022 14:57:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:55824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo84E-0005pc-JX for submit@debbugs.gnu.org; Thu, 27 Oct 2022 14:57:28 -0400 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 1oo847-0002Kh-Gc for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 14:57:19 -0400 Received: from smtpo76.interia.pl ([217.74.67.76]) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oo841-0006bI-VG for bug-gnu-emacs@gnu.org; Thu, 27 Oct 2022 14:57:18 -0400 Received: from localhost (89-64-89-35.dynamic.chello.pl [89.64.89.35]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by www.poczta.fm (INTERIA.PL) with ESMTPSA; Thu, 27 Oct 2022 20:50:24 +0200 (CEST) From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= To: bug-gnu-emacs@gnu.org Subject: [PATCH] Calculate age cutoff at n-th midnight instead of n*24h mark Date: Thu, 27 Oct 2022 20:50:06 +0200 Message-Id: <20221027185006.1033130-1-stlman@poczta.fm> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=interia.pl; s=biztos; t=1666896626; bh=ZsUWkWEVMoeT2POPFE2aClErvduzNIvYdNVHJwMeWIQ=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=fUeN1oOV5WgZKsXTcVBD4lVR9c4Jw3/Vnri/iwWnCjV2m0kkChBMYt42R04jMzlVn hy5mA7wlcGE4d+jssJVEQJSwKwr8K4aAlgEDB3LT2lTtg9Kh+kF4VB7iZjGMvH41MQ 8EHisEaG5AfciVBbMQLP9quQaHKwSdcjf1+ZwtgA= Received-SPF: pass client-ip=217.74.67.76; envelope-from=stlman@poczta.fm; helo=smtpo76.interia.pl X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?=C5=81ukasz=20Stelmach?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) * lisp/gnus/gnus-sum.el (gnus-summary-limit-to-age): Calculate cutoff to point to n-th past midnight (1st is 00:00 today). This way messages sent between n*24h mark and the next midnight will be excluded (or included if limitting to younger messages), which seems more intuitive when users are asked to enter age in days. --- lisp/gnus/gnus-sum.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 18ba55a439..a15dedeccf 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -8323,8 +8323,9 @@ articles." (defun gnus-summary-limit-to-age (age &optional younger-p) "Limit the summary buffer to articles that are older than (or equal) AGE days. -If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to -articles that are younger than AGE days." +Days are counted at midnight so with AGE equal 1 messages sent before 00:00 +today will be included (or excluded). If YOUNGER-P (the prefix) is non-nil, +limit the summary buffer to articles that are younger than AGE days." (interactive (let ((younger current-prefix-arg) (days-got nil) @@ -8347,15 +8348,17 @@ articles that are younger than AGE days." (list days younger)) gnus-summary-mode) (prog1 - (let ((data gnus-newsgroup-data) - (cutoff (days-to-time age)) - articles d date is-younger) + (let* ((data gnus-newsgroup-data) + (now (append '(0 0 0) (cdddr (decode-time)))) + (delta (make-decoded-time :day (* -1 (- age 1)))) + (cutoff (encode-time (decoded-time-add now delta))) + articles d date is-younger) (while (setq d (pop data)) (when (and (mail-header-p (gnus-data-header d)) (setq date (mail-header-date (gnus-data-header d)))) (setq is-younger (time-less-p - (time-since (gnus-date-get-time date)) - cutoff)) + cutoff + (gnus-date-get-time date))) (when (if younger-p is-younger (not is-younger)) -- 2.30.2 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 08:16:47 2022 Received: (at control) by debbugs.gnu.org; 11 Nov 2022 13:16:47 +0000 Received: from localhost ([127.0.0.1]:45299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otTtn-0002Vw-Lp for submit@debbugs.gnu.org; Fri, 11 Nov 2022 08:16:47 -0500 Received: from mail-oa1-f53.google.com ([209.85.160.53]:37754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otTtm-0002VW-2t for control@debbugs.gnu.org; Fri, 11 Nov 2022 08:16:47 -0500 Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-12c8312131fso5384817fac.4 for ; Fri, 11 Nov 2022 05:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=N3Yvf5/T6lk95yJ1zV8H1/PkU4sCgiMH+JOLLZYBygY=; b=GZaF9GRC6YVbglikc2IsTCuCYKFvmiAxW57y7D+1u3yJoqrJYuduxOZRSWN6SDl6RM EqcIarjIHnqU+vUi1migXBKC2p2uSouk2VuVXtTAgn/hSt7hzwmniMYFdyEVpZk2RPns PHzQeI+jcpRdoLFxqQpWJp8dmDGBfRIVmSNtDEC+RQdduhAdB80nwonfTSbpYVOpJ0HQ OKH7pf53thaALCmrNbr9GjRwK1cvNNd5NOGa/AyjiIX4oqJbNtPZJH3INA01FGh7ZfaQ 5FqotkEUOXecqHbiN9iebLSdf2MqnF1XWNXy4Oozr8OM3GDyDj2O7bnqHZ4p2/sc7xmf aSUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=N3Yvf5/T6lk95yJ1zV8H1/PkU4sCgiMH+JOLLZYBygY=; b=EMsqjT6AB71dhp5stxUNiQTlc/V6eQV+/RcKX2o0rd4ojqFGVsdb4HQ57vIwFqwHBv DUarpWyeicgtHCBt+ZjGUD92TZnC+Ub/18a42S8kdBkXD29KUVmcP+cLmVr2efrGBWBF nJg+C1sMi9epKVauFTAq7C7nWoakQ39DV4bJq2A10W66O9ueVbCUvo+K0oBXEF2cx7Kr 9NH/nZIsrH1hFcNNgkVSoF15kR8w1Fk2YOVk01BAMJvhkwF8nTiWhur2EjZrLumjP/6n hQmAkFNXXMCuEkCNfWtMJARSeXKxjJPRvwDIPRFMVFiw8LargPT26k/jFpttau4ZwnbE tsew== X-Gm-Message-State: ANoB5pl3TGBwYkexbJ+0bbCIiztroOZIQU9svo3qL8psK6mabT5vCXjm Jetx+VOSiq2atDe3qxXzJUhv+7G99I0HXXDYcKxwWpNt X-Google-Smtp-Source: AA0mqf4SXp/oPlhL6+8FgMu8UolDR1aH7wS2XEiA7am1Y0zNp0obfTqyLGll5u12B0MZJU2iW1w9je6OTfTbNnLH9mI= X-Received: by 2002:a05:6870:6c15:b0:13b:8a07:2a1f with SMTP id na21-20020a0568706c1500b0013b8a072a1fmr823877oab.199.1668172600645; Fri, 11 Nov 2022 05:16:40 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 11 Nov 2022 05:16:40 -0800 From: Stefan Kangas X-Hashcash: 1:20:221111:control@debbugs.gnu.org::qnOZHm37C48lHj+J:8k5S MIME-Version: 1.0 Date: Fri, 11 Nov 2022 05:16:40 -0800 Message-ID: Subject: control message for bug #58820 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 58820 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 16:29:18 2023 Received: (at 58820) by debbugs.gnu.org; 7 Sep 2023 20:29:18 +0000 Received: from localhost ([127.0.0.1]:41474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeLcr-0006eT-Ls for submit@debbugs.gnu.org; Thu, 07 Sep 2023 16:29:17 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:52257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeLco-0006eC-R9 for 58820@debbugs.gnu.org; Thu, 07 Sep 2023 16:29:15 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-501cef42bc9so2271764e87.0 for <58820@debbugs.gnu.org>; Thu, 07 Sep 2023 13:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694118546; x=1694723346; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=O3/nKD0+JQI4MX9rVEJd0wY8HRejIQZoVvhmcGve+gY=; b=EVRhwqDvCAA/WfLzMfdrc3jv3WqIvkkAN0BI6bsBm/zzDrB/t5kQ6ZmCxH8vqqy6Ww oP4kZZD+xDT0cRgFK2K4KVb8kRSejIMBX90YsH3137dp2AdgCl7UEN7AYXq3HDA43U92 BvkWBjPRG1cylJEBgXEC2X4g83wOgXg5DCSeulwMavbeFNrXgwRB+dVvACNOgf8E/ZZy zvy7XwQYqsBfvmz26sOEIGq7suIqy83DIDJnprSBOleFdV456dsRfu2jwVjrrRUyf2f2 BCW7Y61RFGh2p49Qy3ar2iEXgOiT867uPG7tiMZ7HpmH3DT04oP2+oLoXvZ7dMlcU7Mo 1HFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694118546; x=1694723346; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=O3/nKD0+JQI4MX9rVEJd0wY8HRejIQZoVvhmcGve+gY=; b=fvQBzA6VmPclBtVH8/9iveZsLqVMbPZbHbWMHjcGX3icLz2R2P5PBKbw842iofYevm DlXInCpu09iB7sHFC3IpHNpzzk44HsE2W+PA+CRdwEfPzK16G/1HsUCgNR+axlFmcliY 891TSqek3eqQ/HlbSeyB7kowmvZ+d9KdagMxwOZBpAqqizdd+Rvu87SOYOhChmo2BgIp nVS8nhQcoKnMnTR+jOXDTG55zhRyrbUGsvOI3DuB5m5vLk6s/GzFxwvInS4Pth6Z9j06 l4Mc6znnYxMqAn5z/XktPzfKqj1tTqbxMt1Jr7HRm/WZLg0r5XWjk7vkpEvyYe4TexGQ 6Ixw== X-Gm-Message-State: AOJu0YwVFHCg0FPBtljw/tvxpVZuRNJ5vckKUDczICwCG5yD4vwfpnh/ g/9IP9Jx1/lKOgZN6EttJfhkKqPJx1iSeWNQ14M= X-Google-Smtp-Source: AGHT+IEzJZhOkX1vrwhnc8CIGwB3lXDGoXwKwiWznx5WRvhM2Xl0Libdr2WbOCM8TPbt+n4AZKWnnx6LItBa9jJzKqo= X-Received: by 2002:a05:6512:3489:b0:500:aaea:1494 with SMTP id v9-20020a056512348900b00500aaea1494mr277546lfr.41.1694118546031; Thu, 07 Sep 2023 13:29:06 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 7 Sep 2023 13:29:05 -0700 From: Stefan Kangas In-Reply-To: =?UTF-8?B?PDIwMjIxMDI3MTg1MDA2LjEwMzMxMzAtMS1zdGxtYW5AcG9jenRhLmZtPiAoIsWB?= =?UTF-8?B?dWthc3ogU3RlbG1hY2giJ3MgbWVzc2FnZSBvZiAiVGh1LCAyNyBPY3QgMjAyMiAyMDo1MDowNiArMDIw?= =?UTF-8?B?MCIp?= References: <20221027185006.1033130-1-stlman@poczta.fm> MIME-Version: 1.0 Date: Thu, 7 Sep 2023 13:29:05 -0700 Message-ID: Subject: Re: bug#58820: [PATCH] Calculate age cutoff at n-th midnight instead of n*24h mark To: =?UTF-8?Q?=C5=81ukasz_Stelmach?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58820 Cc: 58820@debbugs.gnu.org, Eric Abrahamsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) =C5=81ukasz Stelmach writes: > * lisp/gnus/gnus-sum.el (gnus-summary-limit-to-age): Calculate cutoff to > point to n-th past midnight (1st is 00:00 today). This way messages sent > between n*24h mark and the next midnight will be excluded (or included > if limitting to younger messages), which seems more intuitive when users > are asked to enter age in days. Eric, do you have any comments on this patch? Thanks in advance. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 23 19:36:38 2023 Received: (at 58820) by debbugs.gnu.org; 23 Sep 2023 23:36:38 +0000 Received: from localhost ([127.0.0.1]:40760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkCAv-0001M8-Ip for submit@debbugs.gnu.org; Sat, 23 Sep 2023 19:36:38 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:39980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkCAp-0001Lo-Vi for 58820@debbugs.gnu.org; Sat, 23 Sep 2023 19:36:35 -0400 Received: from localhost (71-212-75-26.tukw.qwest.net [71.212.75.26]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 33853FA059; Sat, 23 Sep 2023 23:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1695512173; bh=gsaueSbc83haP2Jz1NlmpFXPUTNL6PhoExYjVhEe8t4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QIt98LZH7wEtSFEhYex66tm6CdsmjNHcuhp9P/H27BF7JudktiGg1tTEk7zIwH6bS gic/FQqhzLoijKQrfQFiC3mGOdw0mXAjdiMQvpV3vDQjohrlLxN8td1Cn/br8jur2+ 0qUobLR4dm0QQjSeH8Y5RUMJEq1RKN5cs/2oCkgs= From: Eric Abrahamsen To: Stefan Kangas Subject: Re: bug#58820: [PATCH] Calculate age cutoff at n-th midnight instead of n*24h mark In-Reply-To: (Stefan Kangas's message of "Thu, 7 Sep 2023 13:29:05 -0700") References: <20221027185006.1033130-1-stlman@poczta.fm> Date: Sat, 23 Sep 2023 16:36:11 -0700 Message-ID: <87il80laxg.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58820 Cc: 58820@debbugs.gnu.org, =?utf-8?Q?=C5=81ukasz?= Stelmach X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Stefan Kangas writes: > =C5=81ukasz Stelmach writes: > >> * lisp/gnus/gnus-sum.el (gnus-summary-limit-to-age): Calculate cutoff to >> point to n-th past midnight (1st is 00:00 today). This way messages sent >> between n*24h mark and the next midnight will be excluded (or included >> if limitting to younger messages), which seems more intuitive when users >> are asked to enter age in days. > > Eric, do you have any comments on this patch? Thanks in advance. Hi! I do think this a reasonable change, thanks to =C5=81ukasz for the report. I'd like to apply the attached, which is mostly =C5=81ukasz's code with the addition of a simplification of the argument reading. I've also changed the docstring a bit, as I found the original change a little hard to understand. However, this might not be any better! WDYT? Eric --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-Have-gnus-summary-limit-to-age-operate-on-calendar-d.patch Content-Transfer-Encoding: quoted-printable >From 5b050f666dce02636921f4d1f7529efae6aec856 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sat, 23 Sep 2023 16:31:10 -0700 Subject: [PATCH] Have gnus-summary-limit-to-age operate on calendar days MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Reported and patched by =C5=81ukasz Stelmach . * lisp/gnus/gnus-sum.el (gnus-summary-limit-to-age): Rather than 24-hour blocks. Also use `read-number', and drop the confusing option to reverse younger/older both with the prefix argument and with a negative number. --- lisp/gnus/gnus-sum.el | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index a3be5577f7a..f576d4e6147 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -8331,39 +8331,29 @@ gnus-summary-limit-to-predicate =20 (defun gnus-summary-limit-to-age (age &optional younger-p) "Limit the summary buffer to articles that are older than (or equal) AGE= days. -If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to -articles that are younger than AGE days." +Days are counted from midnight to midnight, and now to the +previous midnight counts as day one. If YOUNGER-P (the prefix) +is non-nil, limit the summary buffer to articles that are younger +than AGE days." (interactive - (let ((younger current-prefix-arg) - (days-got nil) - days) - (while (not days-got) - (setq days (if younger - (read-string "Limit to articles younger than (in days, older when = negative): ") - (read-string - "Limit to articles older than (in days, younger when negative): "))) - (when (> (length days) 0) - (setq days (read days))) - (if (numberp days) - (progn - (setq days-got t) - (when (< days 0) - (setq younger (not younger)) - (setq days (* days -1)))) - (message "Please enter a number.") - (sleep-for 1))) + (let* ((younger current-prefix-arg) + (days (read-number + (if younger "Limit to articles younger than days: " + "Limit to articles older than days: ")))) (list days younger)) gnus-summary-mode) (prog1 - (let ((data gnus-newsgroup-data) - (cutoff (days-to-time age)) - articles d date is-younger) + (let* ((data gnus-newsgroup-data) + (now (append '(0 0 0) (cdddr (decode-time)))) + (delta (make-decoded-time :day (* -1 (- age 1)))) + (cutoff (encode-time (decoded-time-add now delta))) + articles d date is-younger) (while (setq d (pop data)) (when (and (mail-header-p (gnus-data-header d)) (setq date (mail-header-date (gnus-data-header d)))) (setq is-younger (time-less-p - (time-since (gnus-date-get-time date)) - cutoff)) + cutoff + (gnus-date-get-time date))) (when (if younger-p is-younger (not is-younger)) --=20 2.42.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 11 10:57:59 2023 Received: (at 58820) by debbugs.gnu.org; 11 Oct 2023 14:57:59 +0000 Received: from localhost ([127.0.0.1]:39845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqaet-0001Ic-5t for submit@debbugs.gnu.org; Wed, 11 Oct 2023 10:57:59 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:52974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqaeo-0001IH-SP for 58820@debbugs.gnu.org; Wed, 11 Oct 2023 10:57:58 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id CB810FAB23; Wed, 11 Oct 2023 14:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1697036246; bh=WBUKF02+KuCN8X0IPpWDf3+chSsaW6MDR8ZCWaAPqFw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Ys4s/tu4u81LIH7VmNusqQCqic0CGu0YmLLzJkSnQ1+VfXwbtSSUJd03BItFNlCl/ hWYRqKeHirYFk7jhLYmk5nHgAJ+F9SPrHLjg76xaROhGfVkJjFxS/E/aLH8FsTk+QP OIKcDm7o1926INC35JHKApA/YhbRqWQ4V+sgbM/Y= From: Eric Abrahamsen To: Stefan Kangas Subject: Re: bug#58820: [PATCH] Calculate age cutoff at n-th midnight instead of n*24h mark In-Reply-To: <87il80laxg.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 23 Sep 2023 16:36:11 -0700") References: <20221027185006.1033130-1-stlman@poczta.fm> <87il80laxg.fsf@ericabrahamsen.net> Date: Wed, 11 Oct 2023 07:57:24 -0700 Message-ID: <87il7durzf.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58820 Cc: 58820@debbugs.gnu.org, =?utf-8?Q?=C5=81ukasz?= Stelmach X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eric Abrahamsen writes: > Stefan Kangas writes: > >> =C5=81ukasz Stelmach writes: >> >>> * lisp/gnus/gnus-sum.el (gnus-summary-limit-to-age): Calculate cutoff to >>> point to n-th past midnight (1st is 00:00 today). This way messages se= nt >>> between n*24h mark and the next midnight will be excluded (or included >>> if limitting to younger messages), which seems more intuitive when users >>> are asked to enter age in days. >> >> Eric, do you have any comments on this patch? Thanks in advance. > > Hi! > > I do think this a reasonable change, thanks to =C5=81ukasz for the report. > I'd like to apply the attached, which is mostly =C5=81ukasz's code with t= he > addition of a simplification of the argument reading. > > I've also changed the docstring a bit, as I found the original change a > little hard to understand. However, this might not be any better! > > WDYT? I feel fairly okay about this patch, so will apply tomorrow unless anyone complains. Thanks, Eric From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 13 20:02:47 2023 Received: (at control) by debbugs.gnu.org; 14 Oct 2023 00:02:47 +0000 Received: from localhost ([127.0.0.1]:47559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrS7D-0003pc-3Y for submit@debbugs.gnu.org; Fri, 13 Oct 2023 20:02:47 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:33172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrS79-0003pJ-2z for control@debbugs.gnu.org; Fri, 13 Oct 2023 20:02:46 -0400 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 90A40FA151 for ; Sat, 14 Oct 2023 00:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1697241733; bh=ioZqorQ9r7eGqUCqQp5ZaW3R90wj4uEIBRc90jNvF3o=; h=Date:To:From:Subject:From; b=iSkserzbl4M+IGt0XSBW6trzKNZeFmLznPMjn7/9Qj69LRrWvPH/Ivk0lxkgV7N3O hWQcTk9/9g9PRhXUfAHMcHDapExmAoSlmRfMajVjEwtcM8+gHOVwkq3Osu33Im4HkM 4dQC4c4IcOvXwqzgI6Awzk+a5+udKDfsdTq38Cn8= Date: Fri, 13 Oct 2023 17:02:12 -0700 Message-ID: To: control@debbugs.gnu.org From: Eric Abrahamsen Subject: control message for bug #58820 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 58820 30.1 quit From unknown Sun Aug 17 01:46:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 11 Nov 2023 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator