From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 7h2oLFi9Hl/oeAAA0tVLHw (envelope-from ) for ; Mon, 27 Jul 2020 11:41:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2PMaKFi9Hl+3EAAAbx9fmQ (envelope-from ) for ; Mon, 27 Jul 2020 11:41:12 +0000 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 3F8EA940668 for ; Mon, 27 Jul 2020 11:41:12 +0000 (UTC) Received: from localhost ([::1]:34606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k01VH-0006nl-4k for larch@yhetil.org; Mon, 27 Jul 2020 07:41:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k01Uf-0006ne-B4 for emacs-orgmode@gnu.org; Mon, 27 Jul 2020 07:40:33 -0400 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k01Ud-0000q8-Me for emacs-orgmode@gnu.org; Mon, 27 Jul 2020 07:40:33 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1595850028; cv=none; d=zohomail.com; s=zohoarc; b=bH5vqXJ6KkOF7sgWPfJMZJJMY+0/JVWg+kgNqtGM1SQwb0r3gy8MDeSx5bXVEfEKtFPo4eMFzPXl8EvX7pXjdvOubV6kuHifr3QM5gbHbkHCwmA8IvOpGF66J9Ra0Nx2zcUpzeriuSUnA1zrWSPuUA+wnHgJ2yB8R3zKYwtfyCg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595850028; h=Content-Type:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Aiv6pVuNPWIR5KHwRNYoVPWA77ijdVA82o8v9yuePgw=; b=Rkvw7ICs/iJITbxnl69XPf9UCI4+LCo4U5mGFWYTdqIgw5/1JLv1A0uLEFeFbSY5bBce8L3wKUALc9weg/mX4S64WpcOKwY58YawwMt7aG4XZ/E9I39LOtETG9uRaPgYtm7CYIuYVLlPPKdhe7MbSHQxCzV5eEWeU5BmlLK6oZo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=nivekuil.com; spf=pass smtp.mailfrom=kevin@nivekuil.com; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1595850028; s=mail; d=nivekuil.com; i=kevin@nivekuil.com; h=References:From:To:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type; bh=Aiv6pVuNPWIR5KHwRNYoVPWA77ijdVA82o8v9yuePgw=; b=hEHOd41hO7ljkKAXg0O3GkfwRIWADTt8ZYLhbBvIikqehInKnQ+ZGkHGdVW9kxML JDBXHjQmAOCPvoNxbPvDKyH1tGNrbKxohBCxR3UfYUCY097+z+e9oV/ZO+3lkaIzmmn bkF+Zvu3GDz4EYujH2ogAJxEhF9LngSCvBgTE1a4= Received: from machina (71.212.158.154 [71.212.158.154]) by mx.zohomail.com with SMTPS id 1595850020518313.6082887174472; Mon, 27 Jul 2020 04:40:20 -0700 (PDT) References: <87o8o1gpow.fsf@nivekuil.com> User-agent: mu4e 1.5.3; emacs 28.0.50 From: Kevin Liu To: emacs-orgmode@gnu.org Subject: Re: Repeating task hourly In-reply-to: <87o8o1gpow.fsf@nivekuil.com> Date: Mon, 27 Jul 2020 04:40:19 -0700 Message-ID: <87lfj5gp98.fsf@nivekuil.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-ZohoMailClient: External X-Zoho-Virus-Status: 1 Received-SPF: none client-ip=136.143.188.51; envelope-from=kevin@nivekuil.com; helo=sender4-of-o51.zoho.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/27 07:31:04 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none (invalid DKIM record) header.d=nivekuil.com header.s=mail header.b=hEHOd41h; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -2.01 X-TUID: Dkmdv8tclZLf --=-=-= Content-Type: text/plain > Is there any way to do this or are the docs out of date? I made a few quick changes to org-habit and it works prima facie. Will continue testing for a bit. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-habit-allow-hourly-repeat.patch >From e690d7b43143410d5d5af524bb1ff0819feebc24 Mon Sep 17 00:00:00 2001 From: nivekuil Date: Mon, 27 Jul 2020 04:37:32 -0700 Subject: [PATCH] org-habit: allow hourly repeat --- lisp/org-habit.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/org-habit.el b/lisp/org-habit.el index f76f0f213..b9bb729c1 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -157,11 +157,12 @@ means of creating calendar-based reminders." :group 'org-faces) (defun org-habit-duration-to-days (ts) - (if (string-match "\\([0-9]+\\)\\([dwmy]\\)" 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) - '(("d" . 1) ("w" . 7) + '(("h" . 0.04166666666) + ("d" . 1) ("w" . 7) ("m" . 30.4) ("y" . 365.25)))))) (error "Invalid duration string: %s" ts))) @@ -199,9 +200,7 @@ This list represents a \"habit\" for the rest of this module." (setq sr-days (org-habit-duration-to-days scheduled-repeat) sr-type (progn (string-match "[\\.+]?\\+" scheduled-repeat) (match-string-no-properties 0 scheduled-repeat))) - (unless (> sr-days 0) - (error "Habit %s scheduled repeat period is less than 1d" habit-entry)) - (when (string-match "/\\([0-9]+[dwmy]\\)" scheduled-repeat) + (when (string-match "/\\([0-9]+[hdwmy]\\)" scheduled-repeat) (setq dr-days (org-habit-duration-to-days (match-string-no-properties 1 scheduled-repeat))) (if (<= dr-days sr-days) -- 2.27.0 --=-=-=--