From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6L7nOVGeRWOKNwAAbAwnHQ (envelope-from ) for ; Tue, 11 Oct 2022 18:48:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id yPPmOVGeRWPL7AAA9RJhRA (envelope-from ) for ; Tue, 11 Oct 2022 18:48:17 +0200 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 713F184F2 for ; Tue, 11 Oct 2022 18:48:17 +0200 (CEST) Received: from localhost ([::1]:57984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiIQS-0005h4-4A for larch@yhetil.org; Tue, 11 Oct 2022 12:48:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiINJ-0005fQ-Qs for emacs-orgmode@gnu.org; Tue, 11 Oct 2022 12:45:01 -0400 Received: from mail-mw2nam04olkn20813.outbound.protection.outlook.com ([2a01:111:f400:7e8c::813]:50418 helo=NAM04-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 1oiING-000624-QJ for emacs-orgmode@gnu.org; Tue, 11 Oct 2022 12:45:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dtyh2bfvdCDAhre2o5KK05goNDz1AmDOkerjmQQthCjRa0XejUNIATKYNNUIYZWlF5oOKhwB4y5rPvzswcv5i9kb1dTTTPuIWTa6oqBmd9ls7Mia38BAQQZxlQcVk+Wk3OB0wZpQlzOdW0vloOP26KHwN34tS4syiGGMnL+1djKAkut8Htk0uczJhlsKXLLt18r3ZamhycgyIUFVXaxIUd9D9X7ElbZ9nFlo18kbF0eCZISKdqmgu7lm1TFxwue++w8UmXXseq1TC2m5MK3IDyntmaEJsjKl5vZnxfl46+Pc9j5ruQnfx3fI78t9RhKlV5AtepQ9Zdf3mP8ALVnFow== 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=XHe0zPdNNQxspUfvxaZqdXkYX5Cqolp/mnHbZf4lK+g=; b=oOZjFYrNAhk7jx8e1e45heJZvf7v73nir0x32Omx+z2fhbPsi64YZk4cL2epY+6kEdVntfQ6vXaaAKYNPQzwyEs8t3ZRrJskBLyNsNfxZKMCGvHauIurwgrvL9OsqmVgBFue/rYkyp9JUuVFkaJk4WyCRGPUbSnuzHhWifGZtH2G19L6XE9tXoF09X5mfhD/80V25H6u41PugRYcaD93UXioPohjlHtaXb/3N0B8LuRpCIFCQ53aGS5DkbTGsNv/B7KNvmSIUIF+K/d62xWumuAt68akT3DPcBvmHdCXhsFiav112h64bNUG79sReIA+j7Ey3hY584L8Lv5/BbhOcw== 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=XHe0zPdNNQxspUfvxaZqdXkYX5Cqolp/mnHbZf4lK+g=; b=TfzIE4cCuOJ2n0A+8dOGxisJz6QGYAUVUsDi9IgcjT/G8LnxVNfjJXZG815f4jjG0jiDctQEdJZ71PkCVADjV5MAP6+937xIymWQdscmOIGxu/xmZp5oH/ulGvSdAjIUY3y3GIvvdHZs7etZddN8stZq3T01srNB8TQtqwqDReNEZ2Mh8CQrmpMnvtmekvURKcROAJvY8pFK001v5EoGShrBuDguIdyt1/xi9zpZwsrX8Y7J5r/R2OEIOUJ1+sghHtJC8zShY6JdcR6+nk9KVYyRnBdmef7uCTJDrsfYLT3iwy0Qmb98jjDAjXAjWb+whiYa0EMwMn0H87436tBOHg== Received: from DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) by PH0PR03MB6560.namprd03.prod.outlook.com (2603:10b6:510:b2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.21; Tue, 11 Oct 2022 16:39:54 +0000 Received: from DM5PR03MB3163.namprd03.prod.outlook.com ([fe80::6554:f431:b243:a53b]) by DM5PR03MB3163.namprd03.prod.outlook.com ([fe80::6554:f431:b243:a53b%3]) with mapi id 15.20.5709.015; Tue, 11 Oct 2022 16:39:54 +0000 From: Morgan Smith To: emacs-orgmode@gnu.org Subject: [PATCH] Org Habit fix + new feature Date: Tue, 11 Oct 2022 12:39:51 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [35Uj0FGr0b5tJtO+6AE6cbJCA4CAb7+n] X-ClientProxiedBy: YQBPR0101CA0314.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:6c::27) To DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) X-Microsoft-Original-Message-ID: <874jwapb54.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR03MB3163:EE_|PH0PR03MB6560:EE_ X-MS-Office365-Filtering-Correlation-Id: 85b1c4e3-6f16-4466-18c4-08daaba7396a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OJYuCOVLlCC+s6fu2PuuLA8giRkgNMMpYAGLC9GBNOMy+bMps5btPjS07OzRjN+qUcs5v5r1mQvx8j/ihgB8ZyJRpJGrHIUSEIJ0JtFBjsVilAiKkcZZBIwvk4hU457mRDuK7kuine4cp5rZ0PeOVbNvNKLF4orHZ1UuBnbNu0iSjYV6msQxr80Cqcz2gZKA+cTGudiZRi3zRH3ThultlFwakgAJxCUK/Svsv4KYJh7y7SJMWSDGKdwwdV11n+Oo3Skz90jUDoaJg4SbpB9FQEGF4Ad72jIewF760R7qlPjV1QKxqSy4ruSVHFdZZLO2+k4UMqLHhDJdzkmvBidRdrI+UlOoDnqGg32HrWkcBcm37UQlBh1CJUc4cUdr2lan55FuLlhhmdYNouAZZtinDIugasIZeQvVvlg/h0x0OS565cXEOhLIALYL74ExYdpdGAZRsLKoc1J8U8954PyEferUc3FAcNCC5mfwvl5AE+pGJeuL30JK79Vt3QH0dSihBAjBXgtPsvPSpDCJYg+7xdoJx9aXl0bot9dnqentUIfKWlNeSNBG6SsojVsTmuSShss7j4yi7ZoNOnb2Fy1HwvnrshcTd3c81jYg6dW/UHdC2JW+eVo4Bq8QUNlVPy2/hLfOt96DWaAOgkSOYSiC4w== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ACeo077mZ1BgiaPbD7ey5rGY2QN9Dxlk563MSePC9PIdR0TH1Q8RofrmZ1TN?= =?us-ascii?Q?ZChu8BdlOnWDO2g9JWqpjpzqxnaEEszki10aktI78YDTi6KHjman2mcXysnF?= =?us-ascii?Q?4k4WaQKPo7zIAN+wWGbaXpRagXMrbcyINJZg+QDFicoh71qImS3D9WxOxAqS?= =?us-ascii?Q?bGoAT66XT56Rx50mNoJAJbLdOY+X9ns6YMWsM64O8Lx8+NGrRUU3Sl5aAZA1?= =?us-ascii?Q?BOM8v+nHmp4LGo26a2dYOw/aM2DrSk6j+lFiEeN0SjagWXQ/IRqlEfWmmEl1?= =?us-ascii?Q?SupbiLdMqNJPPx7uF/ZC6qweTjMyE1n3AT36PQX23lFOWkepkTYxgtMBvHG7?= =?us-ascii?Q?ZL5ruK5zeHMSuoAmgjwfyxjy8gz51Zx3tA6JqBl+rSNr84vNs9QRCgFmFTGx?= =?us-ascii?Q?DJ023HB/K8PKvMSe/y4dw0FjkcYw75ddD6GpeuuW5g1tvKIEB+A5naJebu9B?= =?us-ascii?Q?jp1hDpnvscNdb6h/6hyZrFOgIihzhaf7C74ZXCH8yWC9JtmSSTAUrcKfTvld?= =?us-ascii?Q?MftbxosnIXWup5qkFV0kHYeYztDOSKXV99bCwm9UJXipLIRjbPLI10AReQrY?= =?us-ascii?Q?11ZqsJRQ3f7ryvQBGuEoFos4wqXPRytiqNhoiCOxxOoI2kPuTyS74FvYw1NT?= =?us-ascii?Q?q+MIBjcwxEMll6xOfc9M0x7G9IqO0tItshj6gzOgtR+P6w8YDiN4YT2f5UrX?= =?us-ascii?Q?4PTXfxdHkh2vOMzGajYhfYez50BH3ktWdXgmbjoWTqhXSoU5QSPvX5jFdG7q?= =?us-ascii?Q?8lpHHql/RvUF7FmzA5Tyvma33oFM5tRSlbzsofY1QpwdbQLXjD+8i3XP3miI?= =?us-ascii?Q?n3TZ51pry0prvEfeKq/s+nD3P82NYQlGZem7CGKX9dh52nX6w4wIsCqDRI6K?= =?us-ascii?Q?c7uyC8SUQet/Ywk4LwMfD1S08QETro1usVD+tJAYTdMbZtsBFAbP69aSe3wK?= =?us-ascii?Q?ZCQ2XIX1Nq2w9Yr7k8LOz4nDAOqgOAKGWyP0YoKyE0e0C7RqFzrd/6QdmOaI?= =?us-ascii?Q?jK4yZq2M65HtynpU/YaqevCJsLsvFhCtRjWnuZHkvLN1QKePEi7pmbz3K8gQ?= =?us-ascii?Q?ZTLgCi5oWttN/8SLarmr2qfLL085jhnv3h5K5/uxVdKTlBNFTUPy+M2giNFy?= =?us-ascii?Q?G4NSUchnJ32NdeWeOFVvYh7npqr13GsjcfO/VbTSNuQQGasd1ibAXYKI459M?= =?us-ascii?Q?BclDUILSh7z3eqbvFEpVzBd/72UDChxcKYtkKSp7sLcbemYuVs1dtT9ExCqR?= =?us-ascii?Q?5G4EPAa9SqPGiR7cC7tRgXb9PAdZUninTWvIeSI//F7efYiDHsJpdyIBvmlv?= =?us-ascii?Q?0W8=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85b1c4e3-6f16-4466-18c4-08daaba7396a X-MS-Exchange-CrossTenant-AuthSource: DM5PR03MB3163.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2022 16:39:54.3426 (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: PH0PR03MB6560 Received-SPF: pass client-ip=2a01:111:f400:7e8c::813; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM04-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665506897; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=XHe0zPdNNQxspUfvxaZqdXkYX5Cqolp/mnHbZf4lK+g=; b=roTwnN+kXRoyV5kYSo7LdVZthY+hUj3amEAOLOukwFaCimFEaLvMeiuZzfZPWJyuI+TnCY aawSWSaNwWfx1ZuzJAETXlYrwqSoCJuEZmdiWbww46ULll1LouLXv4FZw36vwjugmlJJEb yV0O/T0k3kpGkeeaqksR8tazgiE9hh91XmpDIRVxr48QzevbmZ0pqQhebp1VB/J/WScPym i3jhHELsTfKjsklvEruN7dWjU39/i0Pci8V5xYvbg80SVm9hYpnRUDnKeFfxLdFwxnwY4L ZuKxQhtYKzzfTAiIigkZDVLf1jv24x3sQkxs4VdtxQRwC1sUhd6PD9XBHLchUg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1665506897; a=rsa-sha256; cv=pass; b=r1pTQf4NZOmYxQCHpH1cNpxWmoD9cxWEG+WjIv+F/9rWyoQ1cnESApKQXEYvNNeCSKK7g/ 6pQvdthwSbH/MFNzC2t5ZEbYzR7Uztucwp3ef/BBvSRq6Qjm8mbaQZDa++KbmIEozfxa+K himrYtGE4evgv/ErSsR1KKlE1h8+N0Ph2WUFOnWP+eZrzkBcR1jgROG+JFkIg8j188Ymv5 L7n1xkGqEdrUmrv0gvO9MriPeZnGHb4Ovwc8UsF8jTKfMaKbIwQ9j7XyMoX8RWu/DbasGV T8kOZk+0Uf/qjk4HolV6h+D0UXXzkccklpxRPLRaxFz9CMExjVPv8rbzqalIkQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=TfzIE4cC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=outlook.com; 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" X-Migadu-Spam-Score: -4.69 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=TfzIE4cC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=outlook.com; 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" X-Migadu-Queue-Id: 713F184F2 X-Spam-Score: -4.69 X-Migadu-Scanner: scn0.migadu.com X-TUID: tUUXHXGuDnl8 --=-=-= Content-Type: text/plain Hello! There are two patches here. The first one is a simple bug fix that doesn't really have anything to do with the second patch. It just happens to be in the same spot of the code. The second patch allows a habit to be considered done if time was logged to it. Imagine you have an org habit like shaving. Chances are, if you spend time doing it, it's done. I like to set LOGGING to nil for these kinds of habits since it's redundant to have all those state changes that tell me exactly what the logbook already tells me. Let me know what you guys think. Any discussion about the second patch though shouldn't stop the first one from being applied. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-org-habit.el-Use-time-as-a-history-cutoff-point.patch >From cc16dd6a8c59312a75b8e25669a7e4eb3d9f9ef4 Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Tue, 11 Oct 2022 11:44:26 -0400 Subject: [PATCH 1/2] lisp/org-habit.el: Use time as a history cutoff point * lisp/org-habit.el (org-habit-parse-todo): Use time as a cutoff point instead of using a count. This allows viewing the full history of habits that are completed multiple times a day. Previously we would miss some days and show an incorrect history --- lisp/org-habit.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/org-habit.el b/lisp/org-habit.el index 677b7adb6..fe5f4fe63 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -212,11 +212,11 @@ This list represents a \"habit\" for the rest of this module." habit-entry scheduled-repeat)) (setq deadline (+ scheduled (- dr-days sr-days)))) (org-back-to-heading t) - (let* ((maxdays (+ org-habit-preceding-days org-habit-following-days)) + (let* ((firstday (- (org-today) org-habit-preceding-days)) (reversed org-log-states-order-reversed) (search (if reversed 're-search-forward 're-search-backward)) (limit (if reversed end (point))) - (count 0) + (done nil) (re (format "^[ \t]*-[ \t]+\\(?:State \"%s\".*%s%s\\)" (regexp-opt org-done-keywords) @@ -235,13 +235,14 @@ This list represents a \"habit\" for the rest of this module." ("%u" . ".*?") ("%U" . ".*?"))))))))) (unless reversed (goto-char end)) - (while (and (< count maxdays) (funcall search re limit t)) + (while (and (not done) (funcall search re limit t)) (push (time-to-days (org-time-string-to-time (or (match-string-no-properties 1) (match-string-no-properties 2)))) closed-dates) - (setq count (1+ count)))) + (when (< (car closed-dates) firstday) + (setq done t)))) (list scheduled sr-days deadline dr-days closed-dates sr-type)))) (defsubst org-habit-scheduled (habit) -- 2.38.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-lisp-org-habit.el-Allow-clocking-time-to-complete-a-.patch >From 93929b6722e7171551f8390581593e8ea76f1340 Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Tue, 11 Oct 2022 11:46:39 -0400 Subject: [PATCH 2/2] lisp/org-habit.el: Allow clocking time to complete a habit * lisp/org-habit.el: (org-habit-clock-completes-habit): Add (org-habit-parse-todo): Allow clocking time to complete a habit * etc/ORG-NEWS: Add entry for `org-habit-clock-completes-habit' * doc/org-manual.org: Add entry for `org-habit-clock-completes-habit' --- doc/org-manual.org | 6 ++++++ etc/ORG-NEWS | 5 +++++ lisp/org-habit.el | 18 ++++++++++++++---- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 428c79923..a3dcfb3f9 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -4423,6 +4423,12 @@ the way habits are displayed in the agenda. value is ~t~. Pressing {{{kbd(C-u K)}}} in the agenda toggles this variable. +- ~org-habit-clock-completes-habit~ :: + + #+vindex: org-habit-clock-completes-habit + If non-~nil~, a habit is considered done on days that time has been + clocked to it. + Lastly, pressing {{{kbd(K)}}} in the agenda buffer causes habits to temporarily be disabled and do not appear at all. Press {{{kbd(K)}}} again to bring them back. They are also subject to tag filtering, if diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index c18c03725..1a3861f60 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -360,6 +360,11 @@ The new setting, when set to non-nil, makes Org create alarm at the event time when the alarm time is set to 0. The default value is nil -- do not create alarms at the event time. +*** New custom setting ~org-habit-clock-completes-habit~ + +The new setting, when set to non-nil, makes Org consider a habit done +on days that time has been clocked to it. + ** New functions and changes in function arguments *** ~org-fold-show-entry~ does not fold drawers by default anymore diff --git a/lisp/org-habit.el b/lisp/org-habit.el index fe5f4fe63..66aad06c1 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -61,6 +61,11 @@ Note that consistency graphs will overwrite anything else in the buffer." :group 'org-habit :type 'boolean) +(defcustom org-habit-clock-completes-habit nil + "If non-nil, a habit is considered done on days that time has been clocked to it." + :group 'org-habit + :type 'boolean) + (defcustom org-habit-show-habits-only-for-today t "If non-nil, only show habits on today's agenda, and not for future days. Note that even when shown for future days, the graph is always @@ -218,7 +223,7 @@ This list represents a \"habit\" for the rest of this module." (limit (if reversed end (point))) (done nil) (re (format - "^[ \t]*-[ \t]+\\(?:State \"%s\".*%s%s\\)" + "^[ \t]*-[ \t]+\\(?:State \"%s\".*%s%s\\)%s" (regexp-opt org-done-keywords) org-ts-regexp-inactive (let ((value (cdr (assq 'done org-log-note-headings)))) @@ -233,15 +238,20 @@ This list represents a \"habit\" for the rest of this module." ("%t" . ,org-ts-regexp-inactive) ("%T" . ,org-ts-regexp) ("%u" . ".*?") - ("%U" . ".*?"))))))))) + ("%U" . ".*?")))))) + (if org-habit-clock-completes-habit + (concat + "\\|^" org-clock-string ".*\\]--\\(\\[[^]]+\\]\\)") + "")))) (unless reversed (goto-char end)) (while (and (not done) (funcall search re limit t)) (push (time-to-days (org-time-string-to-time (or (match-string-no-properties 1) - (match-string-no-properties 2)))) + (match-string-no-properties 2) + (match-string-no-properties 3)))) closed-dates) - (when (< (car closed-dates) firstday) + (when (<= (car closed-dates) firstday) (setq done t)))) (list scheduled sr-days deadline dr-days closed-dates sr-type)))) -- 2.38.0 --=-=-= Content-Type: text/plain Thanks, Morgan --=-=-=--