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 uNMfGCbaYGNZVgEAbAwnHQ (envelope-from ) for ; Tue, 01 Nov 2022 09:34:46 +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 WET7FybaYGNxbAAA9RJhRA (envelope-from ) for ; Tue, 01 Nov 2022 09:34:46 +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 1A4F93A91E for ; Tue, 1 Nov 2022 09:34:46 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opmiE-0008S9-IB; Tue, 01 Nov 2022 04:33:34 -0400 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 1opmiD-0008Rj-GJ for emacs-orgmode@gnu.org; Tue, 01 Nov 2022 04:33:33 -0400 Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opmi7-00008Z-PJ for emacs-orgmode@gnu.org; Tue, 01 Nov 2022 04:33:33 -0400 Received: from localhost ([::ffff:197.239.4.135]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000081D94.000000006360D9B8.00005A86; Tue, 01 Nov 2022 01:32:55 -0700 Date: Mon, 31 Oct 2022 20:56:08 +0300 From: Jean Louis To: Quiliro =?utf-8?B?T3Jkw7PDsWV6?= Cc: Renato Pontefice , emacs-orgmode@gnu.org Subject: Re: One thing each 3 days but maximum 10 Message-ID: Mail-Followup-To: Quiliro =?utf-8?B?T3Jkw7PDsWV6?= , Renato Pontefice , emacs-orgmode@gnu.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.7+37 (a90f69b) (2022-09-02) Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-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: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667291686; 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=iuliwFl7Y/TwyhJU5iPEmrQ9fCt/PMZHaw5tumOjp5c=; b=Klkb/oqVh8IJhrJZUcVWNX9p5quepd2U7hQm02RLYXwl02rjfNvy3eHUtn1DAyWaTEEGMd coNdVo6NOj7Y/lbVzbq2kS+nZUXYiwEUNUxYUCbX8UIvegMqsl64maQikE2jaMgO1y/R4v lbKYiYUGj5sEK4bMAvl29pLuaMBYBQHgsXH9N826UyUJim8qZcaCZagLfdt6ZMAJ1jZdK0 iwcawPDybAGScurroitTn8F4M77hWuxpqYuMTZHvWZq5FwehBlPseQKIjgzs2ffOKg/Ewu FwWXxVG2QKhVUWdo9a/HFe/qp8KdWM5m9XPJj0z3HApUnF9hGSvFwTBvWn5a+A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667291686; a=rsa-sha256; cv=none; b=P2mmU8Um8XCvAfwv1Nx524WTk7nfDw16YMlr3qUnqubha2ziRVwtpHeLccnpiseLtyfLJ7 vWVg75wYj/Egr2rSsMHBYXdXrr36N7+zdxAthA7LYbdPnzWPa5LYEfhXkYUFHGQIXESNTD Fcd7VGLdoPYK1Lb7WuFTU7TmdcQV+XpOdagxHoXwcFqQEpDtQSlyPeyQCBXaa6txu25HIe mdcZ1obDefIiJkq6Zv1qZneSy3bljLx74gIyQXJv76qmkutxmcXkykbji4rbt3Ueo97zw4 fe/FZlxlY/lgudjIyy5ypauaxAwGK26vSiq7JE4K3cOK9qrq7TY1L1agC9mrFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.07 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1A4F93A91E X-Spam-Score: -2.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: dy4/w+7v4n2D * Quiliro Ordóñez [2022-10-31 13:03]: > El 2022-10-30 23:57, Jean Louis escribió: > > * Renato Pontefice [2022-10-30 19:11]: > >> I have to take a pill each 3 days, but for max 10 times. > >> So I set a TODO pill >2022-10-28 +3d> and each 3 days my calendar tell me that I have to take the pill. But is possible to say 1/10; 2/10; 3/10 etc? > >> I nean to show how many pill I have already take? > > > > Use PostgreSQL to give you schedule: > > > > #+BEGIN_SRC sql :engine postgresql :results value raw > > SELECT '** TODO Take pill again > > SCHEDULED: <' || generate_series('2022-10-28', '2022-11-26', '3 > > day'::interval)::date || E'>\n' > > AS "* My treatement"; > > #+END_SRC > Isn't it much easier to copy the first one and change the day, instead > of going through the learning curve of database administration? Of > course that, if you have a bazooka, you can even write a love letter > with it. But would it be right tool? Any useful tool external to any text file that may help you in work and life, is the right tool. Use anything you find useful. To correct you, this is not "database administration", it is using PostgreSQL like programming language. If there would be ready Emacs Lisp function, I would mention it, but I do not know any. This belowe is pretty much intuitive: SELECT generate_series('2022-10-28', '2022-11-26', '3 day'::interval); SELECT generate_series('2022-10-28', '2022-11-26', '3 day'::interval); generate_series ------------------------ 2022-10-28 00:00:00+03 2022-10-31 00:00:00+03 2022-11-03 00:00:00+03 2022-11-06 00:00:00+03 2022-11-09 00:00:00+03 2022-11-12 00:00:00+03 2022-11-15 00:00:00+03 2022-11-18 00:00:00+03 2022-11-21 00:00:00+03 2022-11-24 00:00:00+03 And you can have it display it with date only: SELECT generate_series('2022-10-28', '2022-11-26', '3 day'::interval)::date; generate_series ----------------- 2022-10-28 2022-10-31 2022-11-03 2022-11-06 2022-11-09 2022-11-12 2022-11-15 2022-11-18 2022-11-21 2022-11-24 And you may concatenate it how you wish: SELECT 'This is my day: ' || generate_series('2022-10-28', '2022-11-26', '3 day'::interval)::date; This is my day: 2022-10-28 This is my day: 2022-10-31 This is my day: 2022-11-03 This is my day: 2022-11-06 This is my day: 2022-11-09 This is my day: 2022-11-12 This is my day: 2022-11-15 This is my day: 2022-11-18 This is my day: 2022-11-21 This is my day: 2022-11-24 And there are complex intervals, readable to human: SELECT 'This is my day: ' || generate_series('2022-10-28', '2022-10-29', '1 hour 2 minutes'::interval); This is my day: 2022-10-28 00:00:00+03 This is my day: 2022-10-28 01:02:00+03 This is my day: 2022-10-28 02:04:00+03 This is my day: 2022-10-28 03:06:00+03 This is my day: 2022-10-28 04:08:00+03 This is my day: 2022-10-28 05:10:00+03 This is my day: 2022-10-28 06:12:00+03 This is my day: 2022-10-28 07:14:00+03 This is my day: 2022-10-28 08:16:00+03 This is my day: 2022-10-28 09:18:00+03 This is my day: 2022-10-28 10:20:00+03 This is my day: 2022-10-28 11:22:00+03 This is my day: 2022-10-28 12:24:00+03 This is my day: 2022-10-28 13:26:00+03 This is my day: 2022-10-28 14:28:00+03 This is my day: 2022-10-28 15:30:00+03 This is my day: 2022-10-28 16:32:00+03 This is my day: 2022-10-28 17:34:00+03 This is my day: 2022-10-28 18:36:00+03 This is my day: 2022-10-28 19:38:00+03 This is my day: 2022-10-28 20:40:00+03 This is my day: 2022-10-28 21:42:00+03 This is my day: 2022-10-28 22:44:00+03 This is my day: 2022-10-28 23:46:00+03 Now after learning about the flexibility and power of that function, you may think of using intervals for anything you wish. Within Org, you may embed it how you wish and want, including, you may produce tables with that function. Org's function `org-clone-subtree-with-time-shift' I find really handy, but I also find it hard coded, it is only for subtree. And I personally can rely on it as Org has too many bugs and is constantly developed. We have just found that "hours" are missing, which speaks of design planning quality level. Why would one exclude seconds? Just because author of function does not use seconds, that is why author excluded seconds, and minutes, and hours in the original function. Do I want to use a function which possibly contains errors? There are too many human errors when dealing with time, unspoken of programming errors. My choice is to use what I consider stable, and which is more flexible. As Org may be dynamically modified by external tool, then I will use any kind of tool. My Org file are mostly on the file system, there are maybe 300 files, and only 38 in the database. But then I use in the database too much of Markdown, and way much more of the text type. And any kind of the markup I want to use embeddable external tools. This is because it is useful. Personally I do not want to remain hard coded to Org type only, as it limits my work, my output, my PDF and HTML files, there are too many problems involved. To embed any external output into anything, I use templating system. RCD Template Interpolation System for Emacs: https://hyperscope.link/3/7/1/3/3/RCD-Template-Interpolation-System-for-Emacs.html Then I can use any kind of programming language and embed it in text or any kind of markuptypes_name | count -------------------------------------------+------- Default (Text) | 42517 Markdown (Discount Markdown) | 4303 Asciidoctor | 264 Markdown (Pandoc, espresso) | 54 Markdown (Discount) with Table of Content | 45 Org | 38 txt2tags | 7 Enriched | 4 Org Heading | 2 PostgreSQL | 2 Kotl | 1 HTML | 1 -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/