4

I'm trying to use my Orgmode calendar via MobileOrg on my Android devices, to push events to the Google calendar, and neither sexp-formatted events nor recurring events (set up with +) seem to appear in Google calendar (for + recurring events the first one appears, but none of the subsequent ones).

The solution would seem to be to create individual entries for every occurrence of the recurring event, which will be tedious and inefficient. I assume there must be a way of harnessing the power of elisp in such a way to create a function which, when given a start date and a stop date and a time-span for recurrence [e.g. every day, every week etc.] (and, ideally, note any skipped dates, e.g. for holidays) and have that function output individual org-mode events. Has anyone done this sort of thing?

2
  • When you complete the recurring task, does Google calendar and/or MobileOrg automatically reschedule it again on the next due date?
    – lawlist
    Commented Jan 21, 2015 at 7:27
  • These are events, not tasks. Commented Jan 21, 2015 at 14:23

1 Answer 1

4

The solution would seem to be to create individual entries for every occurrence of the recurring event, which will be tedious and inefficient.

Why? It would be the way to gain maximum control and AFAIK this is required for repeated events that you want to transfer via e.g. org-caldav.el. The reason is that you need an UID (Unique) for each event to be able to consistently track them (though ox-ical.el does provide such an UID for repeated events set up with e.g. org-class they are ignored by at least org-caldav.el).

Fortunately, org-clone-subtree-with-time-shift has been part of Emacs for a good many years. It will set up n headings for you with a timeshift, like +1w.

Example

(with-temp-buffer
  (save-excursion (insert "* foo\n<2015-01-21 mié>"))
  (org-clone-subtree-with-time-shift 2 "+1w")
  (buffer-substring-no-properties (point-min) (point-max)))

Output

 * foo 
 <2015-01-21 mié>
 * foo
 <2015-01-28 mié>
 * foo
 <2015-02-04 mié>
1
  • org-clone-subtree-with-time-shift seems to be exactly what is wanted to avoid tedious and inefficient inputting of individual events. Commented Jan 21, 2015 at 14:24

Your Answer

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

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