Christian Moe <m...@christianmoe.com> writes:

Org-icalendar-export-to-ics doesn't, but works from the assumption that
you're in a buffer visiting a file. So your elisp function might perhaps
first copy the src block into a buffer, unescape the escaped lines, and
save the file somewhere, before calling org-icalendar-export-to-ics from
that buffer. Is that what you're doing?

Thank you Christian! As usual your feedback helped me understand what I wanted to do. In short, I don't think it's worth the effort, there's no function in icalendar.el like `(org-icalendar-export-string-to-ics SRC_STR DST_STR)`. I just wanted to write in a tutorial the following:

#+BEGIN_SRC org
,* Meeting with friends
:PROPERTIES:
:LOCATION: At Stacy's
:DESCRIPTION: Be on time
:END:
<2025-05-28 Wed 20:00-22:00>
#+END_SRC

Here is the result:

#+BEGIN_EXAMPLE
BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:orgmode_tutorial
PRODID:-//jman//Emacs with Org mode//EN
X-WR-TIMEZONE:CEST
X-WR-CALDESC:Some Orgmode file
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20250616T204032Z
UID:TS1-5c65d2f4-ab93-4256-8981-f6d5548772e5
DTSTART:20250528T200000
DTEND:20250528T220000
SUMMARY:Meeting with friends
LOCATION:At Stacy's
DESCRIPTION:Be on time
CATEGORIES:orgmode_tutorial
END:VEVENT
END:VCALENDAR
#+END_EXAMPLE

Since it's just a one-time thing, I'll just copy&paste the generated .ics file 
content.

Thanks again!

Reply via email to