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 kPwlBwMgyWO9ggEAbAwnHQ (envelope-from ) for ; Thu, 19 Jan 2023 11:48:35 +0100 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 qBYhBwMgyWOLBAEA9RJhRA (envelope-from ) for ; Thu, 19 Jan 2023 11:48:35 +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 DEA3F284A0 for ; Thu, 19 Jan 2023 11:48:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pISSa-000193-HX; Thu, 19 Jan 2023 05:47:57 -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 1pISSV-00018S-T5 for emacs-orgmode@gnu.org; Thu, 19 Jan 2023 05:47:54 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pISST-0005Un-Rc for emacs-orgmode@gnu.org; Thu, 19 Jan 2023 05:47:51 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 8BB5F240604 for ; Thu, 19 Jan 2023 11:47:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674125267; bh=BM6eOfeC+nYdohtqm9eE3WE2tsUTOTBKBqiI5ebJOa4=; h=From:To:Cc:Subject:Date:From; b=KoI8F9oTYkSzIyHmz09t+RXf7MzAZU8s1iBodFdBj11PFWz7eHbbUCyRCZ09t2Zli p+i15hWDKyc2pjdN5w4JwKH5WeVl/t1FFekYhsapyXah7RCtStKVCZN3ftq8n/X+Rz p6OXvT2pa/6lmxAOX39KCUJQ2FniJkccBrGk1qgfYrT0/bRWlLKMXCM6bATv4hpO0y xtI2zHlahIrc+xPq44EY5MfBEav4LgwfcqcEOflJ6bBr2YTpfWnxe6D6qzmrctQVx5 RM1ODthfr3uBpxF4dLtKQeb4ZNCRQn+GVWcW1DsLRIZuOalYZs3ipNuV4n9a4XymKN XF9HzmHwUY/6Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NyK8f4CH2z6tnM; Thu, 19 Jan 2023 11:47:46 +0100 (CET) From: Ihor Radchenko To: Felipe Balbi Cc: emacs-orgmode@gnu.org Subject: Re: org-habit and hourly repeats In-Reply-To: <87ilh4mjnt.fsf@balbi.sh> References: <87ilh4mjnt.fsf@balbi.sh> Date: Thu, 19 Jan 2023 10:48:16 +0000 Message-ID: <87o7qu4x73.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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, SPF_HELO_NONE=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-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=1674125314; a=rsa-sha256; cv=none; b=VIm2TYUxbx7MHAkDeoK9aIBMigs854uvfyxHMz9/CNCpw5oM3xVoRG9r5PK6JsJsKDkaaq jMYQknFfeEKRpW51f3YOTogxISXdk0M7DOfeo0yTuQfgfUvMrWhgW+HpAojDIIvJxP263B NrBW/S5+J8yfT/fLW/loif46ODTk8rqOUJa+Spo3NAQqelmbQzelEOzDhhdLwP3jyPDXVb LhLcDQI/2/WRYIoHhSdz51+T3K3Qt/zipVQ1tvPE3LgO1NEzOVVFFF75/n98Ccp8N637It X0XbOtJA+c1ULhM1SWJVKolPK9KsXAxbFkR0XqCCdXCbDuI55KkTE5YjEjPofg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KoI8F9oT; dmarc=pass (policy=none) header.from=posteo.net; 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=1674125314; 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=hCBMfpP0Z6JVtOM77VaVUimZKE2iFBiDSX5Ta4zGTw4=; b=s9vi9GtjVpSc3kuid6YUzXzIQ91qCgf+SB6ZfD1XB5wFrdYVEDUiMRtUf+NCpdPU1iBTxQ c6brO7E5nPgTiAF4s3PcZhtoZ5GEIqV6tFWWxe+Cn9iuGns0Xb1lHYaD/LVMOttEp6iHhF sgoXOG4hzC4jb8Mi//6xw3ciFkXe0i6BzAT5wjke1YqHhNwrl3gmQE1e6gvMjIkHRkXki3 4yvQA4cwYT77sx/ByFtA2gHvJtlRFbCLF3fF/DYAtVRDq+xtuRyK24/P+FsUSWewqj1Ims EAUaHSW1z8zNg2Bi/DmNmvpulBztD9+cXxQXanzbvDoGJBDtKlLHtwNx9eo8Sw== X-Spam-Score: -7.38 X-Migadu-Queue-Id: DEA3F284A0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KoI8F9oT; dmarc=pass (policy=none) header.from=posteo.net; 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: -7.38 X-TUID: ULengHP4dbZl 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/ > 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. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at