3

As it seems, org-mode capture templates mechanism maybe have changed? I'm using:

Org mode version 9.2.4 (9.2.4-10-g3b006f-elpaplus)

What I'm trying to do is to have a capture template that will create a heading with a DEADLINE, it would prompt for a date, but would use +1m as a default date. So If I do something like this:

  ("s" "Someday" entry (file+headline "~/Dropbox/org/tasks.org" "Tasks")
              "* TODO %?\nDEADLINE: %^t\n")

This works, but the calendar prompt appears with cursor on Today's date, I want it to be +1m, so if I press RET - it will be a month from today. That possible, right?

1 Answer 1

3

You can check org-insert-time-stamp and org-read-date.

("s" "Someday" entry (file+headline "~/Dropbox/org/tasks.org" "Tasks")
          "* TODO %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+1m\"))\n")

Edit: Having the template contain nested %( elements causes each to be evaluated and the result of the inner one is a list, but the engine expects a string or nil

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.