From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id gNFyHUWDkGUmEAAAkFu2QA (envelope-from ) for ; Sat, 30 Dec 2023 21:53:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id SNjHF0WDkGV2VwAA62LTzQ (envelope-from ) for ; Sat, 30 Dec 2023 21:53:25 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=iaWlGWgo; 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=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703969605; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=uWAmEkOS7T2JGxVLlhjptBBcSrjKnxGyohxQybzBVwQ=; b=IgkXOXsW7Tp2fhDB+eDtdYVZlweD4djg7xMPyAxHCLZohSTvzsPgSiY3yKqBWobmjhah+y 9RmtT2K3uSCtNoIV7Khe3IFXNz2+uRqZPZhTFbut0L6qTZyaAxo0FDXwZK2J4k0dJePEvi LWXuhaqgrBwpOTlHIeKp6cjwaNp++VrFo7BqLXLatJnwAdqzJ5wklIrjPCYU8xuEDqMHg4 Dicabj3TW1B5vyVvYCiE73O5ar9BPOaBqmRhNbQzD+Ue8aj7hNcCM+yWPWdcqH5WGi5OWw o6m7WnL5ttj1qXzJjjBWUQEfSUEy3DesmTFMWFyQxOo2N1CvLhXSG9p4Ld79zw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=iaWlGWgo; 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=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=key1; d=yhetil.org; t=1703969605; a=rsa-sha256; cv=pass; b=Jklh3/8h42RG8uAJMxcxExIx01DuNfx2AfMvpNDJ5kE8GMAnrU4xdNnK3Mu4ugjd0crFsO dhbosPJlwUwbNPeCEXpUDHGc5eosJxBzRvdSQCdV1CP4iW00c1YmMUj1nupekohF60qIds MpZ3l2SCb3bJj3ILOpMIf679LQwc4ZqP7EQUQ6tI2rZtFQ3VKegxF3FUF3NDnrpyPAlN13 3y2SPCRLEtEhfMPRxZUQsCaKmRzLzbY7Ek1pivgjn7Yx0ymYLDUZZ7REO+FK4Hk2kjUyUo o7l38/b8IAoGTfwTIF3VvHXDBTpK5s0B8Sdz18c6KkSrvXcefhIg+AunYVVTeg== 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 D5F3C59997 for ; Sat, 30 Dec 2023 21:53:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJgJh-0003aW-BQ; Sat, 30 Dec 2023 15:52:21 -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 1rJgJf-0003a5-6Z for emacs-orgmode@gnu.org; Sat, 30 Dec 2023 15:52:19 -0500 Received: from mail-dm6nam12olkn20816.outbound.protection.outlook.com ([2a01:111:f400:fe59::816] helo=NAM12-DM6-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 1rJgJd-0008BH-3N for emacs-orgmode@gnu.org; Sat, 30 Dec 2023 15:52:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K7GyXKFqH0ux+8nIkRs6NZ89hcCqXDZzRo1R61XSsgw2djfizz0WxewuQB0gPZocY0kV3wAe8+K9Z8a81xzxJgM8WviB8iKfBK4QNPeQvdZK74W9B6FKAPbwAQTkUjAKrebSWQq/xVIvq2wmqD3cYq7b1IV5oIJGhANdjDUewajY0ssvNn6CAaUeuRCISX9r+LyUIX3gLk85n49eHWVnY+HkZ+DwjA/OUjVo5J6VoeSLpmKdh+NA9wysYeG4rfklRSYGcTIJhM+dGXS3mD+6YH/laBQtbSfEd94K2XKa1LoFFD1r947FZnz+SpYMvT78tySGDuy18F3uISiC72Vuyw== 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=uWAmEkOS7T2JGxVLlhjptBBcSrjKnxGyohxQybzBVwQ=; b=fjl7cjwulXcs1sefsYmvm3tTCFHCe8ChZZhKwfc+3mQkJW/nslYFfWUWKBuJ4kuk7+Pxzn2TLUUY5d3Toyl5u5M/JvQa9ZOB++1g2iNtwFrw2CZkGfHLeiNlxUGhg3ygD6vT9cZXKAvggRSWZPdjFNQPwMz1BQpuSu+Xg6Cnb+9964zbBFVrmC0V+VILS7mb8+foNpxKx0T+W2RaIVujVaZvNTFtpn6MDNb7Q3rT+v3gLxAbfydiMsg6PclRmMkXLtQTpIDMbNco5Ki8AVoZDSWYDjQVSoLNViSHnQLlZrjbyfFhJECnXvcevn7BNNtmD0OW5IKX2S1quBEOghnw/A== 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=uWAmEkOS7T2JGxVLlhjptBBcSrjKnxGyohxQybzBVwQ=; b=iaWlGWgoTJIs3DfUZRwUyjW2FmAjhnZgScIJBysJJBbdeHAMmXxCVzF47tcMLaABSd48LshPBngszKRPZCBLoebIxT04UyJQfPIuY3r+/PfvaL4+UWcRM9wy3oCx1acizEk8mJQ1FUX2ANC/yTIsagp7JL0TlQCdCUjLD836NuLTiUbn1Zx5bPpo1DiY757vmESEcdsv6ah9xLWVK5l/2MIx/WfmNGPqfKOzkoyS/R2VdX3j30VqANm6kEmtlkXFYEDHb9WyjeSAyyOdhYoroS2N4qqLMJLzXGByXD1fCwlfPE+Blfgc7MtOjCjN7Rw/WAiqj9HPu5D1n5GnOVNEFA== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by MW4PR84MB1393.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:303:1a4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.22; Sat, 30 Dec 2023 20:47:11 +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.022; Sat, 30 Dec 2023 20:47:11 +0000 From: Morgan Smith To: emacs-orgmode@gnu.org Cc: Morgan Smith Subject: [PATCH] Fix org-agenda-skip-scheduled-if-deadline-is-shown bug Date: Sat, 30 Dec 2023 15:45:47 -0500 Message-ID: X-Mailer: git-send-email 2.41.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [6ntMtOutEip7b9PtGibLIyT0waQ06eCF] X-ClientProxiedBy: YT1PR01CA0047.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:2e::16) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <20231230204546.30215-2-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|MW4PR84MB1393:EE_ X-MS-Office365-Filtering-Correlation-Id: 12795d83-f80d-4e45-a037-08dc09787f09 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gTHTi7bbmqAV4jbXMLd8P1DWjQpg2XIA3uyP7r0iYi1SGGgVodBP61Z2gzG3YHxCQ58V6Bk0y4gg/e9OKACSn4IeiDfmbUApY0KZeP/CoP0OnN0u1zl0AKq90ANv4lVU0KP8sIVLnDEWTnguIZo/1DA/KF0ytZkrbVjccj95F+NJOFAz9LlEvZOX2p0xcMdbHQ2ok65z/AZ2ggShHm48ZGCG3Ud3Fikazd8D/qLYJ/gE+hXMaPenGEIf1qVOF6iizpBOMPxBHt0Qv06LcsoXKqqttk7g6zK52BNh3khjgDcLj8sO2j4m4GuhraXnkKylFgntyAsc9TeOWq2DXCzDLnBfx3mJAHjLjsw/tvtBQRIcrw9cwFhaCStfZ7nH73aMfNyMJ5qPK2q4uHMKvQwI2FM5cPth7+MwUZsi3vPqkrKycbRRGA8VGLy6oPuUUsx5rf+PNy+rfY2f3OStrW9ikJfJPiXhS9c50+c/qEAaqnPvyu2S/UlTFeDjOFb42NURSz0s/5hRpnn5fN2XR1EIawKAEsTMRnnk8Y81af0/SInGV/oVIYQhhOP3OlUvE8QsREQ4DCCF9PQavTOyqVB95P4E7EkP8UD3OqF9+SEzqQM= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZR6rcG27M+dXWX+L9p88WMTd9005yG5u6V97+66X+sRlPPLlp5DcQBVS0ZNd?= =?us-ascii?Q?WJ96FPSRSqhzyrvfZlZSMXD3lZHDzyumIklFR42h/jzCNalyIzGNJspVU4PL?= =?us-ascii?Q?vQcMpHt632Nr+Ih1VO/2AehFk+Tev+sZEeBc20lTuW96AlejqCmxXKJu+XLA?= =?us-ascii?Q?N6cncMG5boHSzG+7NQBiT+HLgsLGrEnDRj1TZ1f+Jdkdv/YZIcZ07DGEE6Ea?= =?us-ascii?Q?8j31aTyxWPRd5+eMpysl0SxMZ5TYO8uuLnCDCSZTgoD0e5wAAPeVDOnTEXb+?= =?us-ascii?Q?CR3o/GUmIx5W/4+0HRxw1DNa52k4oXaLZEsMfTw+WcRvt73f87hfFaYMS0Yy?= =?us-ascii?Q?cdDaMkyL4Lj7lgeDzPo1oGGbnExC9Db2DHt+OqsFd6VSSSute5UwtOjsCD43?= =?us-ascii?Q?zPpiJoXp7DMMpMR8jk9X7ACT5iGKoqB3sTHd4eKvhN6CKmTp0idzccXK5Yb3?= =?us-ascii?Q?dGRnOTl1WMBwIm4T+b0Z4dhdc5RRtAy5xjxEbvz0VB4dE0utGGbj97si1rec?= =?us-ascii?Q?hQa0oORyVC8XSzMcSPeizDU0T6ymSCb3Q/pEgbpUxnis7SrI4Rt6+s5RNvfj?= =?us-ascii?Q?sKKjbZw5FsZdtPQ1Pf9NVN0mEJP9SfZrruc//UB34Z7QBHY/MR7nJCgctbKR?= =?us-ascii?Q?n3i+bmkr9KokJuS9g83tCJf5anyUaBVKcCveUfTB70FDsgj3Rt9jPot/XjCB?= =?us-ascii?Q?OkZTeu2/KScngVLrIpuqivyhLNBc44UTCFuaiB9NKvnu2ddtvbPkxmKsk6uL?= =?us-ascii?Q?YJuBKUDMx/1yxpJxc62lPnBNO/jlNT1L45gW5sLdr9G9TiXFLztFT5G1qFx0?= =?us-ascii?Q?lYs0THnZF5kGQ8zrlxlbYhsAmjDtpNo08JVUWT9hV2nBT/55nKR0ud0H4Sqm?= =?us-ascii?Q?/KkN2fqqxjUeJQZu4xtTwuq1AaMgZKpOsoVbdP25KU+kFtvI6+aSMCyqzO2L?= =?us-ascii?Q?lsZlb3jYp58U8cj3NWDaiaTwtgItxW3mK+EQESuUE5HLjHOsJvGeaQPoqqwy?= =?us-ascii?Q?INgCffg+zgeicZtNPZ9ehaV3RytS1+DeOn8tND+TA4C5Fc8IxoLkEFF4/BTx?= =?us-ascii?Q?TjZ7ah7iCFOHDhYJZ6VyA1pBKd3DLPB6ZdmjCi7dKc1AaIpcSl3CiDkz2WRY?= =?us-ascii?Q?Uurchc/sFlnpSqjO2oPm558hY4HYkynLq2+SvYi+FtOXLwlXO9ahnhEgvsn9?= =?us-ascii?Q?eMMW0npqRm+cD4lvB1++c4Lf+uGz8zhJkZx9evFYVeJtGPSenIq9T0spVkg?= =?us-ascii?Q?=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12795d83-f80d-4e45-a037-08dc09787f09 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2023 20:47:11.4229 (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: MW4PR84MB1393 Received-SPF: pass client-ip=2a01:111:f400:fe59::816; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM12-DM6-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, 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -7.72 X-Spam-Score: -7.72 X-Migadu-Queue-Id: D5F3C59997 X-Migadu-Scanner: mx10.migadu.com X-TUID: N/ovzFaB95I7 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'. --- lisp/org-agenda.el | 49 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index a1b2f3dc4..df1e8cb7d 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6606,25 +6606,26 @@ scheduled items with an hour specification like [h]h:mm." (futureschedp (> schedule today)) (habitp (and (fboundp 'org-is-habit-p) (string= "habit" (org-element-property :STYLE el)))) + (deadline (and (or org-agenda-skip-scheduled-delay-if-deadline + org-agenda-skip-scheduled-if-deadline-is-shown) + (when-let ((timestamp (org-element-property :deadline el))) + (time-to-days + (org-timestamp-to-time + timestamp))))) (suppress-delay - (let ((deadline (and org-agenda-skip-scheduled-delay-if-deadline - (org-element-property - :raw-value - (org-element-property :deadline el))))) - (cond - ((not deadline) nil) - ;; The current item has a deadline date, so - ;; evaluate its delay time. - ((integerp org-agenda-skip-scheduled-delay-if-deadline) - ;; Use global delay time. - (- org-agenda-skip-scheduled-delay-if-deadline)) - ((eq org-agenda-skip-scheduled-delay-if-deadline - 'post-deadline) - ;; Set delay to no later than DEADLINE. - (min (- schedule - (org-agenda--timestamp-to-absolute deadline)) - org-scheduled-delay-days)) - (t 0)))) + (cond + ((not (and deadline org-agenda-skip-scheduled-delay-if-deadline)) nil) + ;; The current item has a deadline date, so + ;; evaluate its delay time. + ((integerp org-agenda-skip-scheduled-delay-if-deadline) + ;; Use global delay time. + (- org-agenda-skip-scheduled-delay-if-deadline)) + ((eq org-agenda-skip-scheduled-delay-if-deadline + 'post-deadline) + ;; Set delay to no later than DEADLINE. + (min (- schedule deadline) + org-scheduled-delay-days)) + (t 0))) (ddays (cond ;; Nullify delay when a repeater triggered already @@ -6661,16 +6662,14 @@ scheduled items with an hour specification like [h]h:mm." ;; doesn't apply to habits. (when (pcase org-agenda-skip-scheduled-if-deadline-is-shown ((guard - (or (not (memq (line-beginning-position 0) deadline-pos)) + (or (not deadline) habitp)) nil) (`repeated-after-deadline - (let ((deadline (time-to-days - (when (org-element-property :deadline el) - (org-time-string-to-time - (org-element-interpret-data - (org-element-property :deadline el))))))) - (and (<= schedule deadline) (> current deadline)))) + (and (<= schedule deadline) (> current deadline))) + ((guard + (not (memq (line-beginning-position 0) deadline-pos))) + nil) (`not-today pastschedp) (`t t) (_ nil)) -- 2.41.0