* One thing each 3 days but maximum 10 @ 2022-10-30 16:08 Renato Pontefice 2022-10-31 4:26 ` Ihor Radchenko 2022-10-31 4:57 ` Jean Louis 0 siblings, 2 replies; 10+ messages in thread From: Renato Pontefice @ 2022-10-30 16:08 UTC (permalink / raw) To: emacs-orgmode 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? Thank you Renato ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: One thing each 3 days but maximum 10 2022-10-30 16:08 One thing each 3 days but maximum 10 Renato Pontefice @ 2022-10-31 4:26 ` Ihor Radchenko 2022-10-31 4:57 ` Jean Louis 1 sibling, 0 replies; 10+ messages in thread From: Ihor Radchenko @ 2022-10-31 4:26 UTC (permalink / raw) To: Renato Pontefice; +Cc: emacs-orgmode Renato Pontefice <renato.pontefice@gmail.com> writes: > 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? Try * TODO take pills [3/10] SCHEDULED: <2022-10-31 Mon .+3d> - [X] take 1 - [X] take 2 - [X] take 3 - [ ] take 4 - [ ] take 5 - [ ] take 6 - [ ] take 7 - [ ] take 8 - [ ] take 9 - [ ] take 10 -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: One thing each 3 days but maximum 10 2022-10-30 16:08 One thing each 3 days but maximum 10 Renato Pontefice 2022-10-31 4:26 ` Ihor Radchenko @ 2022-10-31 4:57 ` Jean Louis 2022-10-31 5:16 ` Ihor Radchenko 2022-10-31 10:01 ` Quiliro Ordóñez 1 sibling, 2 replies; 10+ messages in thread From: Jean Louis @ 2022-10-31 4:57 UTC (permalink / raw) To: Renato Pontefice; +Cc: emacs-orgmode * Renato Pontefice <renato.pontefice@gmail.com> [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 #+RESULTS: * My treatement ** TODO Take pill again SCHEDULED: <2022-10-28> ** TODO Take pill again SCHEDULED: <2022-10-31> ** TODO Take pill again SCHEDULED: <2022-11-03> ** TODO Take pill again SCHEDULED: <2022-11-06> ** TODO Take pill again SCHEDULED: <2022-11-09> ** TODO Take pill again SCHEDULED: <2022-11-12> ** TODO Take pill again SCHEDULED: <2022-11-15> ** TODO Take pill again SCHEDULED: <2022-11-18> ** TODO Take pill again SCHEDULED: <2022-11-21> ** TODO Take pill again SCHEDULED: <2022-11-24> -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: One thing each 3 days but maximum 10 2022-10-31 4:57 ` Jean Louis @ 2022-10-31 5:16 ` Ihor Radchenko 2022-10-31 6:08 ` Jean Louis 2022-10-31 10:01 ` Quiliro Ordóñez 1 sibling, 1 reply; 10+ messages in thread From: Ihor Radchenko @ 2022-10-31 5:16 UTC (permalink / raw) To: Jean Louis; +Cc: Renato Pontefice, emacs-orgmode Jean Louis <bugs@gnu.support> writes: > * Renato Pontefice <renato.pontefice@gmail.com> [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 > > #+RESULTS: > * My treatement > ** TODO Take pill again > SCHEDULED: <2022-10-28> > > ** TODO Take pill again > SCHEDULED: <2022-10-31> This is not a good idea for pills. Without SQL, one could also use org-clone-subtree-with-time-shift, but AFAIK, the whole idea behind schedule of taking pills is to retain certain concentration of medicine in the blood flow. Hence .+3d repeater (3d from the last time taking the pill) is more suitable. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: One thing each 3 days but maximum 10 2022-10-31 5:16 ` Ihor Radchenko @ 2022-10-31 6:08 ` Jean Louis 2022-10-31 6:27 ` Ihor Radchenko 0 siblings, 1 reply; 10+ messages in thread From: Jean Louis @ 2022-10-31 6:08 UTC (permalink / raw) To: Ihor Radchenko; +Cc: Renato Pontefice, emacs-orgmode * Ihor Radchenko <yantar92@posteo.net> [2022-10-31 08:15]: > Jean Louis <bugs@gnu.support> writes: > > > * Renato Pontefice <renato.pontefice@gmail.com> [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 > > > > #+RESULTS: > > * My treatement > > ** TODO Take pill again > > SCHEDULED: <2022-10-28> > > > > ** TODO Take pill again > > SCHEDULED: <2022-10-31> > > This is not a good idea for pills. I am afraid you forgot the fact that prescriptions have variable time periods. It is rather unusual to take pills every 3 days, and rather common for many diseases to take pills every 8 or 12 hours. > Without SQL, one could also use org-clone-subtree-with-time-shift, but > AFAIK, the whole idea behind schedule of taking pills is to retain > certain concentration of medicine in the blood flow. Hence .+3d repeater > (3d from the last time taking the pill) is more suitable. If we ask Org documentation what is "repeater", then I get this information: Timestamp with repeater interval A timestamp may contain a _repeater interval_, indicating that it applies not only on the given date, but again and again after a certain interval of N days (d), weeks (w), months (m), or years (y). The following shows up in the agenda every Wednesday: * Pick up Sam at school <2007-05-16 Wed 12:30 +1w> And that excludes hours, unspoken of other intervals. That renders the function `org-clone-subtree-with-time-shift' not suitable for prescription notification. In fact it is great health risk to recommend to people to use Org to track one's medical treatment due to too many "bugs" involved. And here is hours "repeater" by using external tool PostgreSQL: #+BEGIN_SRC sql :engine postgresql :results value raw SELECT '** TODO Take pill again SCHEDULED: <' || generate_series('2022-10-28', '2022-11-04', '8 hours'::interval)::timestamptz || E'>\n' AS "* My treatement"; #+END_SRC #+RESULTS: * My treatement ** TODO Take pill again SCHEDULED: <2022-10-28 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-28 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-28 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-29 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-29 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-29 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-30 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-30 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-30 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-31 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-31 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-10-31 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-01 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-01 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-01 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-02 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-02 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-02 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-03 00:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-03 08:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-03 16:00:00+03> ** TODO Take pill again SCHEDULED: <2022-11-04 00:00:00+03> -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: One thing each 3 days but maximum 10 2022-10-31 6:08 ` Jean Louis @ 2022-10-31 6:27 ` Ihor Radchenko 2022-10-31 17:14 ` Jean Louis 0 siblings, 1 reply; 10+ messages in thread From: Ihor Radchenko @ 2022-10-31 6:27 UTC (permalink / raw) To: Jean Louis; +Cc: Renato Pontefice, emacs-orgmode Jean Louis <bugs@gnu.support> writes: > If we ask Org documentation what is "repeater", then I get this > information: > > Timestamp with repeater interval > A timestamp may contain a _repeater interval_, indicating that it > applies not only on the given date, but again and again after a > certain interval of N days (d), weeks (w), months (m), or years > (y). The following shows up in the agenda every Wednesday: > > * Pick up Sam at school > <2007-05-16 Wed 12:30 +1w> > > And that excludes hours, unspoken of other intervals. Thanks for pointing this out! Hours are, in fact, allowed. Fixed the manual now. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5098404b19962042cd29ad86e11ccb43ac566953 -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: One thing each 3 days but maximum 10 2022-10-31 6:27 ` Ihor Radchenko @ 2022-10-31 17:14 ` Jean Louis 2022-11-01 8:40 ` Ihor Radchenko 0 siblings, 1 reply; 10+ messages in thread From: Jean Louis @ 2022-10-31 17:14 UTC (permalink / raw) To: Ihor Radchenko; +Cc: d Renato Pontefice, emacs-orgmode * Ihor Radchenko <yantar92@posteo.net> [2022-10-31 09:27]: > Thanks for pointing this out! > Hours are, in fact, allowed. > Fixed the manual now. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5098404b19962042cd29ad86e11ccb43ac566953 That is great. How certain is that function, does it work reliably? How was it tested? I still do get: user-error: Invalid shift specification +1h Org mode version 9.4.3 (9.4.3-elpa @ /home/data1/protected/.emacs.d/elpa/org-20201216/) -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: One thing each 3 days but maximum 10 2022-10-31 17:14 ` Jean Louis @ 2022-11-01 8:40 ` Ihor Radchenko 0 siblings, 0 replies; 10+ messages in thread From: Ihor Radchenko @ 2022-11-01 8:40 UTC (permalink / raw) To: Jean Louis; +Cc: d Renato Pontefice, emacs-orgmode Jean Louis <bugs@gnu.support> writes: > * Ihor Radchenko <yantar92@posteo.net> [2022-10-31 09:27]: >> Thanks for pointing this out! >> Hours are, in fact, allowed. >> Fixed the manual now. >> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5098404b19962042cd29ad86e11ccb43ac566953 > > That is great. > > How certain is that function, does it work reliably? How was it > tested? > > I still do get: > > user-error: Invalid shift specification +1h > > Org mode version 9.4.3 (9.4.3-elpa @ > /home/data1/protected/.emacs.d/elpa/org-20201216/) Hour repeaters are only parsed interactively on main. Repeaters in timestamps should work in earlier Org versions as well. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: One thing each 3 days but maximum 10 2022-10-31 4:57 ` Jean Louis 2022-10-31 5:16 ` Ihor Radchenko @ 2022-10-31 10:01 ` Quiliro Ordóñez 2022-10-31 17:56 ` Jean Louis 1 sibling, 1 reply; 10+ messages in thread From: Quiliro Ordóñez @ 2022-10-31 10:01 UTC (permalink / raw) To: Renato Pontefice, emacs-orgmode El 2022-10-30 23:57, Jean Louis escribió: > * Renato Pontefice <renato.pontefice@gmail.com> [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 > > #+RESULTS: > * My treatement > ** TODO Take pill again > SCHEDULED: <2022-10-28> > > ** TODO Take pill again > SCHEDULED: <2022-10-31> > > ** TODO Take pill again > SCHEDULED: <2022-11-03> > > ** TODO Take pill again > SCHEDULED: <2022-11-06> > > ** TODO Take pill again > SCHEDULED: <2022-11-09> > > ** TODO Take pill again > SCHEDULED: <2022-11-12> > > ** TODO Take pill again > SCHEDULED: <2022-11-15> > > ** TODO Take pill again > SCHEDULED: <2022-11-18> > > ** TODO Take pill again > SCHEDULED: <2022-11-21> > > ** TODO Take pill again > SCHEDULED: <2022-11-24> 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? ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: One thing each 3 days but maximum 10 2022-10-31 10:01 ` Quiliro Ordóñez @ 2022-10-31 17:56 ` Jean Louis 0 siblings, 0 replies; 10+ messages in thread From: Jean Louis @ 2022-10-31 17:56 UTC (permalink / raw) To: Quiliro Ordóñez; +Cc: Renato Pontefice, emacs-orgmode * Quiliro Ordóñez <quiliro@riseup.net> [2022-10-31 13:03]: > El 2022-10-30 23:57, Jean Louis escribió: > > * Renato Pontefice <renato.pontefice@gmail.com> [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/ ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-11-01 8:41 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-10-30 16:08 One thing each 3 days but maximum 10 Renato Pontefice 2022-10-31 4:26 ` Ihor Radchenko 2022-10-31 4:57 ` Jean Louis 2022-10-31 5:16 ` Ihor Radchenko 2022-10-31 6:08 ` Jean Louis 2022-10-31 6:27 ` Ihor Radchenko 2022-10-31 17:14 ` Jean Louis 2022-11-01 8:40 ` Ihor Radchenko 2022-10-31 10:01 ` Quiliro Ordóñez 2022-10-31 17:56 ` Jean Louis
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).