emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-orgmode@gnu.org
Subject: Re: counter macro in dates?
Date: Wed, 23 Aug 2017 01:27:20 -0500	[thread overview]
Message-ID: <87pobmkddj.fsf@alphapapa.net> (raw)
In-Reply-To: CAN_Dec8Gq+vyOt5j6POnOaQqXKng15opw-DFCxVjk1kG7mRqbQ@mail.gmail.com

Matt Price <moptop99@gmail.com> writes:

> I'd love to be able generate dates dynamically using the {{{n}}} org
> macro, or some other mechanism. I don't immediately see how that would
> be possible but maybe someone can guide me. I'd want to do something
> equivalent to this pseudo-elisp:
>
> (let ((base-date 2017-09-05))
> (+ base-date (* 7 {{{n}}}))
>
> I haven't looked into how date objects are parsed in org-mode, though,
> so I have no idea how hard it would be to actually implement something
> like this.

Apologies to the list for practically spamming this recently, but it
seems directly relevant:

https://github.com/abo-abo/tiny

It has built-in support for Org dates with its %(date) function.
Apparently it can be used like this:

m\n8|**** TODO Learning from Data Week %(+ x 2) \nSCHEDULED: <%(date "Oct 7" (* x 7))> DEADLINE: <%(date "Oct 14" (* x 7))>

Which results in:

**** TODO Learning from Data Week 2
SCHEDULED: <2013-10-07 Mon> DEADLINE: <2013-10-14 Mon>
**** TODO Learning from Data Week 3
SCHEDULED: <2013-10-14 Mon> DEADLINE: <2013-10-21 Mon>
[...]

  reply	other threads:[~2017-08-23  6:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 19:25 counter macro in dates? Matt Price
2017-08-23  6:27 ` Adam Porter [this message]
2017-08-23 21:02   ` Kaushal Modi
2017-08-24  1:45     ` Adam Porter
2017-08-24 10:39       ` Kaushal Modi
2017-08-24 15:30       ` Kaushal Modi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pobmkddj.fsf@alphapapa.net \
    --to=adam@alphapapa.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).