From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oGwLBoUiyWMr3wAAbAwnHQ (envelope-from ) for ; Thu, 19 Jan 2023 11:59:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iGoMBoUiyWOlsgAA9RJhRA (envelope-from ) for ; Thu, 19 Jan 2023 11:59:17 +0100 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 BD6E02E9ED for ; Thu, 19 Jan 2023 11:59:16 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIScm-0003o3-Tt; Thu, 19 Jan 2023 05:58:28 -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 1pIScj-0003nh-DQ for emacs-orgmode@gnu.org; Thu, 19 Jan 2023 05:58:25 -0500 Received: from mail-pl1-f178.google.com ([209.85.214.178]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pISch-000700-LQ for emacs-orgmode@gnu.org; Thu, 19 Jan 2023 05:58:25 -0500 Received: by mail-pl1-f178.google.com with SMTP id g23so1936338plq.12 for ; Thu, 19 Jan 2023 02:58:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OP37Wo9sT0wU2/+mITAIs04hRSrJtmpBaazCBM1Wxkg=; b=LQmgSsQfPbRmJM4tclIS6nTyzKX2AkaxA0hh/6Hj1oEA02jgICXy0KyiVM2y/E8gbp lLa10HlW0I4QkgWlk+6fUs+bczuWdoyNALw3HyNJdHoM2WwGasMWxy/o3cTsmncfFTSg qfm8NWnLg5dpxjNoxMkUf7ipurSdB9Xe3FQxNnHL9phIVmo9BngVgIoZraMfdieogbYW VRF8YfWHaP0KwWVY4k+wIXyKHGpyyVxrtROgOCVazSRnJYIlPSWWTAZDk4+bCTQKKDnZ aDY/SmOT1VI1iwikcPogpd2jUjJaZKMszktVXBfpyoKDBizZO7OQ0L10OgA53ogw9q8r Sq5Q== X-Gm-Message-State: AFqh2koWGPTqb1w4xZKWWEDO1GIT5K71lZfDt4Wp2MhZDvx1OSV2CeEk RTu7H1tkwxmjny6ezl87TZ5ssr0Dkt2EYSTB8xo= X-Google-Smtp-Source: AMrXdXsRuLneohphztiYH7rylWnrtVZ4EUqptU1gWpe0y6+Tsn6R9pKjEpRN4zeoi3+865GlwzAk76BdDRZUdm2LIq4= X-Received: by 2002:a17:90a:e38b:b0:229:3677:5536 with SMTP id b11-20020a17090ae38b00b0022936775536mr836422pjz.134.1674125900816; Thu, 19 Jan 2023 02:58:20 -0800 (PST) MIME-Version: 1.0 References: <87ilh4mjnt.fsf@balbi.sh> <87o7qu4x73.fsf@localhost> In-Reply-To: <87o7qu4x73.fsf@localhost> From: Felipe Balbi Date: Thu, 19 Jan 2023 12:58:09 +0200 Message-ID: Subject: Re: org-habit and hourly repeats To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=209.85.214.178; envelope-from=balbif@gmail.com; helo=mail-pl1-f178.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674125956; a=rsa-sha256; cv=none; b=ac5cz6VdqIyW/Rmh2mJO+dVGHMLFkBtXumilQOld/U1gyyU18byUxeJIq/n4LOq/sf63u3 b9XD1Q6mQ5Tdrox9CGcg6rAp6UDWq5WjA9Usfisxu9ReTw0EX8m2MjE79xNoD6TEN3ahnn IRdzT/8pHNSWhMHq2IP9UqTY51ge6e7ewJsyWA76czIfh5RG17p1wcs+fisIjlALeFVoO4 /n6m+6ih5xk2gDir7aXP7AhYYSbUGP2hdE64eE7f0/do/60dN5KUX0MnDrpfRb56iTO0so +WUwSHSV+nZv/OIbcMY9fjucnRQXUKv42+UBgGR5CQ3BW4NkvQz6nB/MHiFSwA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674125956; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=OP37Wo9sT0wU2/+mITAIs04hRSrJtmpBaazCBM1Wxkg=; b=k7QNXmvsMb3/7MxepMVI3DoVvmVrmichPAldusIjGyy/kR5IyGCU0MqnH3b12lvYhqWCNn 26D5VToy28EMMbrmD3kvX4SBkPhnc/2v4dOozBNnW85c5B5wvP6EeFKUiHlvkoK2NnfQi8 DK65uDcr4xCqiAih98OUkv1qYvh/bqx9Hh7BMMVN+ArNkNkSgwhSSuUfOqk0wRV4mbymox qSr7vM2jAFyU1Ek0u5DMYgwVxVUKCZS5eWhDPDvjlz6rzOPqBprIFx6A3lUSNE67BeZ/eF /xQQ3MWBfmtTjinwQz79NvtnmtwSZ5WxEs0JGka8AjLZBQBBWfzdK0zH2FF86A== X-Spam-Score: 1.27 X-Migadu-Queue-Id: BD6E02E9ED Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: 1.27 X-TUID: iVul4NsunMh7 Hi, On Thu, Jan 19, 2023 at 12:47 PM Ihor Radchenko wrote= : > > Felipe Balbi writes: > > > I'm trying to start using `org-habit' but I noticed that hourly repeats > > are not properly parsed by `org-habit-duration-to-days', however that's > > a valid use case --- e.g. drinking water, medicine schedule, > > physiotherapy sessions during the day, periodically practicing a new > > language. For example, here's an easy TODO item that reproduces the > > problem: > > Habits occurring multiple times a day are not properly supported in > general. See https://list.orgmode.org/orgmode/87leplsggg.fsf@localhost/ That's very interesting, because repeated tasks clearly mention hourly repe= ats: https://orgmode.org/manual/Repeated-tasks.html "You can use yearly, monthly, weekly, daily and hourly repeat cookies by using the =E2=80=98y=E2=80=99, =E2=80=98m=E2=80=99, =E2=80=98w=E2=80=99, = =E2=80=98d=E2=80=99 and =E2=80=98h=E2=80=99 letters." > > > It appears that a simple solution would be modify > > `org-habit-duration-to-days' to accept the `h' suffix and set it to a > > fraction of a day, something like: > > > > 8< -------------------- cut here -------------------- > > > > (defun org-habit-duration-to-days (ts) > > (if (string-match "\\([0-9]+\\)\\([hdwmy]\\)" ts) > > ;; lead time is specified. > > (floor (* (string-to-number (match-string 1 ts)) > > (cdr (assoc (match-string 2 ts) > > '(("h" . 0.042) ("d" . 1) > > ("w" . 7) ("m" . 30.4) > > ("y" . 365.25)))))) > > (error "Invalid duration string: %s" ts))) > > > > 8< -------------------- cut here -------------------- > > > > Would something like this be an acceptable solution? > > I afraid that things are not that simple. Do you mind expanding on this? Just generally curious, really. --=20 balbi