Skip to content

Commit 618bf4c

Browse files
committed
Move CRLF conversion for future-proofing
ox-icalendar export of CRLF line endings may change in future to be more consistent and better agree with RFC 5545 [1], but this may cause surprising breakage, because emacs will then open the ICS file in DOS coding, removing the ^M endings from the buffer string. This commit moves `org-caldav-convert-buffer-to-crlf' earlier to guarantee the ^M is present and avoid possible breakage. [1] See discussion about CRLF starting at https://list.orgmode.org/87o7oetneo.fsf@localhost/T/#m3e3eb80f9fc51ba75854b33ebfe9ecdefa2ded24
1 parent cc1b820 commit 618bf4c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

org-caldav.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,14 +1087,14 @@ ICSBUF is the buffer containing the exported iCalendar file."
10871087
(unless (string-match (car cur) uid)
10881088
(error "Could not find UID %s" (car cur)))
10891089
(org-caldav-narrow-event-under-point)
1090+
(org-caldav-convert-buffer-to-crlf)
10901091
(org-caldav-cleanup-ics-description)
10911092
(org-caldav-maybe-fix-timezone)
10921093
(org-caldav-set-sequence-number cur event-etag)
10931094
(org-caldav-fix-todo-priority)
10941095
(org-caldav-fix-todo-status-percent-state)
10951096
(org-caldav-fix-categories)
10961097
(org-caldav-fix-todo-dtstart)
1097-
(org-caldav-convert-buffer-to-crlf)
10981098
(message "Putting event %d of %d Org --> Cal" counter (length events))
10991099
(if (org-caldav-put-event icsbuf)
11001100
(org-caldav-event-set-etag cur 'put)
@@ -1210,6 +1210,7 @@ This is a bug in older Org versions."
12101210
(when (search-forward "BEGIN:VTODO" nil t)
12111211
(search-forward "PRIORITY:")
12121212
(unless (eq (thing-at-point 'number) 0)
1213+
;; NOTE: Deletion up to eol-1 assumes the line ends with ^M
12131214
(delete-region (point) (- (point-at-eol) 1))
12141215
(insert (number-to-string
12151216
(save-excursion

0 commit comments

Comments
 (0)