From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iCmjAM5ylGV0BQEAkFu2QA (envelope-from ) for ; Tue, 02 Jan 2024 21:32:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id qPTcNc1ylGVvPQAAe85BDQ (envelope-from ) for ; Tue, 02 Jan 2024 21:32:13 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=outlook.com header.s=selector1 header.b=WhaxB2+r; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704227533; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Y62lUbeWMcqQuJR7UJi6RQJIOY5Hbmk65mRQrZG/vyc=; b=Sk/dCGtN9qUNBUfB3ol+a1Gdp1Gao2W+stbu7AnyH4TvjthmpmQpxuIBoqEuiGTPKQcIzT pFLGzZdVlSp2H1d+5jxwTmVk+IPpy0xAEdvu/hFgrleRV4N2YjZOg8WItlSXBvoZBhoyn8 2yCRhqVzS47cs92ZBHUJYkvNVEccBMpESAVe9EPF0WB09G70ptn4EzD8Vb7Uhmuo8b8gKE 2c2xskOwn09XxmjQWDBq6l0ZgSh2Cv1WDH70yHTuwqluIAJHCYmWWrMgxtp9bj6O+xDpFk 6QHMcDZ46ztW1BxeAblujnlp1UWrQCmfIXTZM2XPWc3km5VVgN+TfmR7Dg4X1w== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1704227533; a=rsa-sha256; cv=fail; b=l91Iq8O+MtMhDQyFegtX0JK3pZnlq2ZfuopOCQQlAYeH7ohyU7DcMo97TYpmvbJAGAf/ni T7kERRDUZo/eyROySi1YxtGPYysacIszc7pw7zPty9QleczL/9Ny2KhfXvao2QLePJo0vJ 5ezvJhNDsQQCCICTrUsWO6EUYmC/C+bPWqwgQMri7QBbnoe+vuv+ex/75RRd92K1sODO18 dR+IU0Vkc+Pd2xKampcKT8DYEGKTRoVkNKyXkMcRzm5voaU9y6AON4xEX5Bi96MQY2PmMl xtA9Zeub5BrPlrS2Nivemc06j4ssE4ApjHqvo2TmMrggEXMXggG8tmFbBqZauA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=outlook.com header.s=selector1 header.b=WhaxB2+r; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 89FF813103 for ; Tue, 2 Jan 2024 21:32:13 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKlPv-0000lU-AC; Tue, 02 Jan 2024 15:31:15 -0500 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 1rKlPn-0000l6-Pu for emacs-orgmode@gnu.org; Tue, 02 Jan 2024 15:31:09 -0500 Received: from mail-mw2nam10olkn20801.outbound.protection.outlook.com ([2a01:111:f403:2c12::801] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rKlPk-000882-1M for emacs-orgmode@gnu.org; Tue, 02 Jan 2024 15:31:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FIbscPWdVSDeijTEhyDdFVKyWi9Etvq5cxLaJzZMaYSzbSpSJ1W/8B2SWRHJXm2T0RARaMvp0csCMuorEHxeYyno591ojkYGhUJmw6O3HeQtWfP+0Gzym0DIeg9XNFaio+Y/IgOP8HlA+CUjrpCfiEkU7lAyvm/dQQtstZn/Meca8ahMKiPmGcvsND4h7mqDm0ERnES1drGbuAYtN10Hkm7oEtEuKwAwj71kJ1iH0PFsBqYJRgOeUT9diiU/hWsTKmCXT8L4eGGBXfhlsWWRVtwvhykXJLaBoP95Yq3c8rWWXems8dJfDs63c6r++hRjA8QpE7nYdLaFrFMUybgYBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E30t9zbmCcLzSUFRrX9x5/OzS/VvCVzNmEYFOZxS6Z0=; b=eCOYGcxqDtgN4pNDF7gHpiP7X0lOuCXwM7N7240hi2T8jtX0JTJfvspOa03lH+MCw0ekZ+Ur6mr3C75CzlBSx56/BAesfqlbSx53d6G9YZ5TX/Q0hrXFKP8ClrKQ/RvqsDQFlRtZbLlCi4hrsGdiTqfaTc9OV84xhFoTs0HIi7f9BEFJtb076csp23OQeFopCY8tNupqVdpwjrke6/WbCBytutB+Tdt/ygeRmO5AqQSn2+EoOe0yHAuioVJnSryauc6hYJ48zYDqa4yJwW7HovYHalg8uvPE+PjZDa65ztYCfYrHqTLCPbUeSBeHgjhZlvWeoGPslqaRFxhqGd2OqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E30t9zbmCcLzSUFRrX9x5/OzS/VvCVzNmEYFOZxS6Z0=; b=WhaxB2+ryT1/0EhCjUgjYRRh5oiYhxh+m/zEvPvzTDYilTn65cAOsbDpLbX3xfi1pwpxAUTo3TSbawalMXmdLCqqKLjqVmt1Bj8RwBHyXyHqti/PqDHBvFAGNp0gkvW92xqRsMboENNe+Kd2qpW4mzIb3No8T/74aU3LcKLwBn8oGHcspW9+DwE1qJg8XG1UTuG+8lXWeP+YXNQL15O2VfCm6oIThvyaxWc1nCpalVxDcIDxCe28qtytkj2zRIz2eyAZtfsmpzysFlPkEol17BiFGLPzw77KvY0fR2rCWmStKo3HkzJxr45VBvlz6m4gdwB922G/PtcRHi8HQDgAjw== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by PH7PR84MB3762.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:510:310::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.13; Tue, 2 Jan 2024 20:25:59 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::c18a:a34b:77d7:f265]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::c18a:a34b:77d7:f265%2]) with mapi id 15.20.7135.023; Tue, 2 Jan 2024 20:25:59 +0000 From: Morgan Smith To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Fix org-agenda-skip-scheduled-if-deadline-is-shown bug In-Reply-To: <87wmsu788v.fsf@localhost> (Ihor Radchenko's message of "Sun, 31 Dec 2023 14:32:32 +0000") References: <87wmsu788v.fsf@localhost> X-Hashcash: 1:20:240102:yantar92@posteo.net::CNvWL3T8lODtZ0l8:97lB X-Hashcash: 1:20:240102:emacs-orgmode@gnu.org::wNZQ0hmFMTdvY9qa:4hm1 Date: Tue, 02 Jan 2024 15:25:58 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [YSy+Foa72qRyq1d0Fc3hnsO1BtzmZSUs] X-ClientProxiedBy: YT4PR01CA0270.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:109::20) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <87jzor7a95.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|PH7PR84MB3762:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d43b9b5-31c4-4f00-d661-08dc0bd10817 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: srLCSdIPxjR3XbphvbdCr81qdnjz6dh/5r3WL8ul7kdEXkGTjxggbYSpRIo+b1/5e8h4X9ZxeQiPmByjxsMRWMBGZY3C3N6r3aaO7GwZf4SnT0NZRDEIhycMRL+1EyK4EgDeYI8/u8ju6HVez+7AGU/LJUIFA78zIhl8FAO+KEdi+WOxt2ligh90zZADQvjfiO/w+xygi2C0moUy9M2s5GIgu4K+CxjBl1lvIsQrnBwgoFaSwHZiFjCpeiweKMzsndpCXQLYU6MPLOU20RrbUe6wtEhLxiiTNbg9GXzHLnzdqDMXsVl7eNQjZCH03jQd9rnug+gNMtEtnzqYrTM+NvjFzUqdVn6pRHkXrAvzWouJxSb6M5/A5pisj02ZHJELMVGHIC1V221TirpNfzl00j9WrTTdYTx8DX1G+WdmHTo21Ivh+cZfBnn+UuYpAZbotElQamEvzBC/OnJ4vv7o52Cl4d4BqM4z3h/7jo29VFeTVVnP4uw4XG30sUKXN0Prb/ReAszfn4NvlBpC0JMUWrn0Qc4S/ay6neXibKQgjDIEBxaCitNFllorr2XlzdrJ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?927JZuxiFCltmWWReMDWUeaVvhp4DJ6lPeUZV1k78crPgfuI9w7qRpe8+z/9?= =?us-ascii?Q?Bs2nUSDc1ne+YLmqjPq7tcBT0R/4HnpmIioIJ4quyMf2EpLayVtFQ2Jvs5lk?= =?us-ascii?Q?+YuxSaBuf78oC61cCVzprkKde429044aKDFELNyteykvDWC+heGsCUUyo+nI?= =?us-ascii?Q?M7vtiDvigZogyz+TsWLQz/cAoY+bh+kly1rfKxanAppeFB735bxAtUisRdAQ?= =?us-ascii?Q?pDNQb7BYbf99kvgo/taCroQTRX5JmZ85btE/vZrv9Dq4/YPR8NUO/N7AaJia?= =?us-ascii?Q?z1obyZoaadTrYFSWfEg1EXyXN1VQkRk/Tup5uC59B7Uzfn1k2DR8jPqD4cOG?= =?us-ascii?Q?45fhxW3WEZ/w/ahWGv5YQjujv9LMU8BRv813nkid6K37liQ3dpMGQVkDQybT?= =?us-ascii?Q?CeuLli+eaPVV/OwFhbf7B7SCUxdCj+elkD97q03cBNmLjp5W8YidibeGRF0/?= =?us-ascii?Q?rnthKvWs4TwRrDAnQLW+c9IsUOMDIj7zy7vN+u7P0mdAdMuPpGRdxZzbWBYh?= =?us-ascii?Q?eVDZA1fS30ErYVAVot8SHbJvPJFyCcUT9gGkLnJjZuJn/tETbV/BL/FtiJg6?= =?us-ascii?Q?d9F+qc0DAhyMO2qx2fuE7QPXwltfp4Cq9cpG/W22JaYfLjqleOu2LHISsIOj?= =?us-ascii?Q?hZ9rxdNJNPIrXNe3g0vkSbp1ei+kNc73DHjJjyeg7TZHjMycy24ZF2K96Iu8?= =?us-ascii?Q?zUnfmo3Dv0uMgkHVVdstv2sTRTtGEA0KSaTnCnVjf8fktg7wmB9uHqeWgdpm?= =?us-ascii?Q?QwtsYanebSv0CVTK4Z7AiGvFp3v3hdwCPHFWJaR4wI1cs2L/imXFCm+9sYu9?= =?us-ascii?Q?UHqQLfsYtq01foqWOrbzSQ+9Sxp6Qh3OuCEQkqmEkNpAXMXQqMRUlPu8iRjC?= =?us-ascii?Q?SM38M9gHpRW9aimVS9XZ3HxVaaOtGwN1evhTkiTI6blDrBLAm1CJ7NEm0Ocz?= =?us-ascii?Q?eDweCWUqfCG0KZKXpgNGumZBc3Eo4zjUwtaH8/K5pwQ5Gy+V1P0CPKRPYkeS?= =?us-ascii?Q?CQV4v59ta+EU8JIx+Jq/DN8sTATRKQZhVpllRKmc5TGLhs7K+sPTb9qdtyH0?= =?us-ascii?Q?L2asUoHhpFvJTxieR6RkqCftH/lJUCRGKh2NEr8r4mW3p/gCeOqitgMmoXQz?= =?us-ascii?Q?TlZMDNfRIxsIcxUW/4WRsbXWbV+71W4/1wX0kyXIiinrLrC35eQagY2LIcxI?= =?us-ascii?Q?CW+fesmoWlYkWl7K8gUz7TiuT/SAGdWitLXC0tIER3gh0eexNUI1Qw8jOXQ?= =?us-ascii?Q?=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d43b9b5-31c4-4f00-d661-08dc0bd10817 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2024 20:25:59.4425 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR84MB3762 Received-SPF: pass client-ip=2a01:111:f403:2c12::801; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM10-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.08 X-Spam-Score: -4.08 X-Migadu-Queue-Id: 89FF813103 X-Migadu-Scanner: mx12.migadu.com X-TUID: rFYWd5UF+pyP --=-=-= Content-Type: text/plain Ihor Radchenko writes: > Morgan Smith writes: > >> lisp/org-agenda.el (org-agenda-get-scheduled): Consolidate deadline >> fetching code. Don't check if deadline is shown when >> 'org-agenda-skip-scheduled-if-deadline-is-shown' has a value of >> 'repeated-after-deadline'. >> >> Currently when 'org-agenda-skip-scheduled-if-deadline-is-shown' has a >> value of 'repeated-after-deadline' then there is no effect. This is >> because when 'org-agenda-get-scheduled' is run on later dates, the >> previous deadlines are not put in 'deadline-pos'. > > May you please provide a detailed reproducer demonstrating the bug you > are trying to fix? Such reproducer could be a basis of a new test. See a detailed reproducer attached to this mail. It has a task defined as this: * TODO task SCHEDULED: <2017-03-06 Mon +2d> DEADLINE: <2017-03-10> Running said reproducer currently fails as follows (the numbers are the days of the month). (string-equal "06\nScheduled: task\n08\nScheduled: task\n10\nScheduled: task\nDeadline: task\n" "06\nScheduled: task\n08\nScheduled: task\n10\nScheduled: task\nDeadline: task\n12\nScheduled: task\n") As you can see, we expect to not see anything scheduled after the deadline if 'org-agenda-skip-scheduled-if-deadline-is-shown' is set to 'repeated-after-deadline', however, we actually see that things continue to be scheduled. Hence the bug is that that option currently does nothing. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Testing-Add-tests-for-org-agenda-skip-scheduled-if-d.patch >From d7e72b9f0189b98d7ae59f0a56d54ffe70583956 Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Tue, 2 Jan 2024 14:25:07 -0500 Subject: [PATCH] Testing: Add tests for 'org-agenda-skip-scheduled-if-deadline-is-shown' * testing/lisp/test-org-agenda.el (test-org-agenda/org-agenda-skip-scheduled-if-deadline-is-shown): New test. --- testing/lisp/test-org-agenda.el | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el index 409d44192..6618fabc5 100644 --- a/testing/lisp/test-org-agenda.el +++ b/testing/lisp/test-org-agenda.el @@ -651,6 +651,51 @@ functions." (should (= arg-f-call-cnt 1)) (should (equal f-called-args '(1 2 3)))))) +(ert-deftest test-org-agenda/org-agenda-skip-scheduled-if-deadline-is-shown () + "Test values for `org-agenda-skip-scheduled-if-deadline-is-shown'." + (cl-assert (not org-agenda-sticky) nil "precondition violation") + (cl-assert (not (org-test-agenda--agenda-buffers)) + nil "precondition violation") + (dolist (test-time '("2017-03-06" "2017-03-10")) + (let ((org-agenda-custom-commands + '(("f" "no fluff" agenda "" + ((org-agenda-overriding-header "") + (org-agenda-todo-keyword-format "") + (org-agenda-prefix-format "%s") + (org-agenda-format-date "%d") + (org-agenda-show-all-dates nil))))) + (org-deadline-warning-days 0) + (todayp (string= test-time "2017-03-10"))) + (dolist (org-agenda-skip-scheduled-if-deadline-is-shown (list nil t 'not-today 'repeated-after-deadline)) + (org-test-at-time test-time + (org-test-agenda-with-agenda + " +* TODO task +SCHEDULED: <2017-03-06 Mon +2d> DEADLINE: <2017-03-10> +" + (should + (string-equal + (concat "06\n" + "Scheduled: task\n" + (if todayp ; We don't show repeats scheduled in the past + "" + "08\nScheduled: task\n") + "10\n" + (if (and org-agenda-skip-scheduled-if-deadline-is-shown + (not (and (not todayp) (eq org-agenda-skip-scheduled-if-deadline-is-shown 'not-today))) + (not (eq org-agenda-skip-scheduled-if-deadline-is-shown 'repeated-after-deadline))) + "" + (if todayp + "Sched. 4x: task\n" + "Scheduled: task\n")) + "Deadline: task\n" + (unless (eq org-agenda-skip-scheduled-if-deadline-is-shown 'repeated-after-deadline) + "12\nScheduled: task\n")) + (progn + (org-agenda nil "f") + (substring-no-properties (buffer-string))))) + (org-test-agenda--kill-all-agendas))))))) + (provide 'test-org-agenda) -- 2.41.0 --=-=-=--