0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-05 02:13:02 +00:00

ox-icalendar: Apply folding to whole VCALENDAR

Moves the calls to `org-icalendar-fold-string' out of
`org-icalendar--vevent' and `org-icalendar--vtodo', instead calling it
from `org-icalendar--vcalendar'.  This way, the string folding applies
to the entire VCALENDAR rather than just the VEVENT or VTODO, as
required by the iCalendar spec.

See also:
https://list.orgmode.org/m2pm85jyw1.fsf@eglen.org.uk/T/#md08cfd0209f6332a1a0c6a54f08544006ff93aed

* lisp/ox-icalendar.el (org-icalendar--vevent, org-icalendar--vtodo):
Remove call to `org-icalendar-fold-string'.
(org-icalendar--vcalendar): Add call to `org-icalendar-fold-string'.
This commit is contained in:
Jack Kamm 2023-04-15 21:47:58 -07:00
parent 7c8623be96
commit f4446ce795

View file

@ -747,7 +747,6 @@ only. CLASS contains the visibility attribute. Three of them
should be treated as \"PRIVATE\" if they are unknown to the iCalendar server.
Return VEVENT component as a string."
(org-icalendar-fold-string
(if (eq (org-element-property :type timestamp) 'diary)
(org-icalendar-transcode-diary-sexp
(org-element-property :raw-value timestamp) uid summary)
@ -771,7 +770,7 @@ Return VEVENT component as a string."
"CATEGORIES:" categories "\n"
;; VALARM.
(org-icalendar--valarm entry timestamp summary)
"END:VEVENT"))))
"END:VEVENT")))
(defun org-icalendar--vtodo
(entry uid summary location description categories timezone class)
@ -797,7 +796,6 @@ Return VTODO component as a string."
:day-start (nth 3 now)
:month-start (nth 4 now)
:year-start (nth 5 now)))))))
(org-icalendar-fold-string
(concat "BEGIN:VTODO\n"
"UID:TODO-" uid "\n"
(org-icalendar-dtstamp) "\n"
@ -824,7 +822,7 @@ Return VTODO component as a string."
(if (eq (org-element-property :todo-type entry) 'todo)
"NEEDS-ACTION"
"COMPLETED"))
"END:VTODO"))))
"END:VTODO")))
(defun org-icalendar--valarm (entry timestamp summary)
"Create a VALARM component.
@ -890,6 +888,7 @@ as a communication channel."
NAME, OWNER, TZ, DESCRIPTION and CONTENTS are all strings giving,
respectively, the name of the calendar, its owner, the timezone
used, a short description and the other components included."
(org-icalendar-fold-string
(concat (format "BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:%s
@ -902,7 +901,7 @@ CALSCALE:GREGORIAN\n"
(org-icalendar-cleanup-string tz)
(org-icalendar-cleanup-string description))
contents
"END:VCALENDAR\n"))
"END:VCALENDAR\n")))