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 oBwwCSoad2UaRQEAkFu2QA (envelope-from ) for ; Mon, 11 Dec 2023 15:18:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id AEqsBCoad2U7dQEA62LTzQ (envelope-from ) for ; Mon, 11 Dec 2023 15:18:18 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="M2QiI/Pc"; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702304297; 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=jQlRZ+Tz+ThW4TOdu72Ju/5cA07aMRLmTwci5rcGiXM=; b=mg+AesU7h+oxJwe2dj/MGCsy7xOm2hUumO2Q3fq0fRywjtwc+p2P18ogC8+an/pbxkxtv3 W/1q8mmZb2WxQZ5M7jvhJcBY7eYBq5LWMo1XDC5YIWgQ37PPU3CMR3mMFv/qgL+nqMAeVp iYl+yM076egO4gmykSA7hfR2Lwj6sp1UPK24YSmkDLulvFSud41fMsDBUGyq/J/Sw3GOo+ TaucMgMwbnZNmHP/PbAUdObbARR6FwoRoeSjUVfhp9x17hnxMnANoPkAMZZyNnwsqdZJ7m iTD9nM3J7CZPKM97fVy8yR0Ewv1u6DNrCBRI/v2+81t2w+bFosJy5kgz+4f3Og== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702304297; a=rsa-sha256; cv=none; b=NuJBK0Qsj80BGgzkA8mnwTwTY33uf4dES4FoJkqiUgsvziEQJpK4lh6aJZs6gOUbbZ14eA Wkf/L9grMwMcxQCBwCJbW1dj1TeCPDw5UW2XX2bXEMTIoa7h+CieQHkdK+3/AubULZH2EM f6vp0hWmozq6i31at8ZmtePzH6Pp7e/6acguSRKm05Jz8vw5w8Tc3CrBgC41yHSvkrcj2H OPgzwQ9FCv+wLIyhMjyctfDHBX2RXWQOyLgxbf6znYu/5FGcMxCh8dJK15p1Onsirt7qqT hTmvrnGxY+ZTwriomw7ml0evdR4BkAwvIgqwEOlQ81KuH842hk1k2ONm8kZe2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="M2QiI/Pc"; 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=posteo.net 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 02CB14387B for ; Mon, 11 Dec 2023 15:18:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCh66-0007jy-7m; Mon, 11 Dec 2023 09:17:26 -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 1rCh62-0007jW-9p for emacs-orgmode@gnu.org; Mon, 11 Dec 2023 09:17:23 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCh5z-0002nL-OU for emacs-orgmode@gnu.org; Mon, 11 Dec 2023 09:17:21 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 656AE240103 for ; Mon, 11 Dec 2023 15:17:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1702304237; bh=VFq/AMrMpLeLWfKH3Ms7h2m/l5MBQiuniCbD1OkzRnA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=M2QiI/PcW88LP7eN1BKsUKvSohPOFG98jmo+DUqvJ2jpaArl8odUF9moQsB0N1W2W v0LkAFYWeg1j3w+VLUnfA9uTM8Alvf1yOI7TcfGrv014VDFFZWz8zFXdiQimWPv0JA a3+jZiGNnHmm8A5xaV9KGAuYGqoyisSLIbXAXMVhYnmlC5fNoZMOQS/9Iw8QfrT/Dz 7E8ZsAbhLSTwfQCHElt3hDAbtNXhGch8zvJ9mnM6PaIxqWXrxF4t3zo6ZWTj7Lz98B hsZ5MEIPqiVmLqGrNNvYi5A1AiBojyesG8FjBxDqLjcUZy1IW4HxxGz26lhddhuouJ NJW5dJKN/CveA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SpkMw3l0sz6tws; Mon, 11 Dec 2023 15:17:16 +0100 (CET) From: Ihor Radchenko To: Raffael Stocker Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] Hard-coded and inconsistent todo states in org-agenda.el [9.7-pre (release_9.6.12-934-g4d72f3 @ /home/rst/Devel/org-mode/lisp/)] In-Reply-To: References: Date: Mon, 11 Dec 2023 14:20:23 +0000 Message-ID: <874jgo95y0.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: -0.81 X-Spam-Score: -0.81 X-Migadu-Queue-Id: 02CB14387B X-Migadu-Scanner: mx11.migadu.com X-TUID: Z6Qs0SlPK+Yk --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Raffael Stocker writes: > Hi, > > org-agenda.el contains the following hard-coded states in =E2=80=98org-ag= enda-to-appt=E2=80=99: > > (when (and ok tod (not (string-match "\\`DONE\\|CANCELLED" evt)))...) Thanks for reporting! May you try the attached patch? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-agenda-to-appt-Do-not-hard-code-not-done-todo-ke.patch >From 6ffa23a01acad2d5cd37bafa11a57cf7a0c13cec Mon Sep 17 00:00:00 2001 Message-ID: <6ffa23a01acad2d5cd37bafa11a57cf7a0c13cec.1702304402.git.yantar92@posteo.net> From: Ihor Radchenko Date: Mon, 11 Dec 2023 15:17:41 +0100 Subject: [PATCH] org-agenda-to-appt: Do not hard-code not-done todo keywords * lisp/org-agenda.el (org-agenda-to-appt): Use org-todo-regexp and org-not-done-regexp to determine whether an even is already done. Reported-by: Raffael Stocker Link: https://orgmode.org/list/yplmsf4ac6va.fsf@mnet-mail.de --- lisp/org-agenda.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index ac8adda7a..6a9b1cc5a 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -11141,10 +11141,16 @@ (defun org-agenda-to-appt (&optional refresh filter &rest args) (string-match cat-filter cat)) (and (stringp evt-filter) (string-match evt-filter evt))))))) - (wrn (get-text-property 1 'warntime x))) + (wrn (get-text-property 1 'warntime x)) + (todo-regexp (get-text-property 1 'org-todo-regexp x)) + (not-done-regexp (get-text-property 1 'org-not-done-regexp x))) ;; FIXME: Shall we remove text-properties for the appt text? ;; (setq evt (set-text-properties 0 (length evt) nil evt)) - (when (and ok tod (not (string-match "\\`DONE\\|CANCELLED" evt))) + (when (and ok tod + ;; Exclude done items unconditionally. + (or (not (and todo-regexp (string-match-p todo-regexp evt))) ; no todo keyword + (and not-done-regexp (string-match-p not-done-regexp evt)) ; or not done + )) (setq tod (concat "00" (number-to-string tod))) (setq tod (when (string-match "\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)\\'" tod) -- 2.42.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--