ox-icalendar: Add support for multi-line SUMMARY, LOCATION, and DESCRIPTION

* lisp/ox-icalendar.el (org-icalendar-entry): Use `org-entry-get' to
account for both PROP and PROP+ in SUMMARY, LOCATION, and DESCRIPTION
properties.  Use newline as accumulated value separator.
* etc/ORG-NEWS (iCalendar export now supports multiline =SUMMARY=,
=LOCATION=, and =DESCRIPTION= properties): Announce the breaking
change.
* doc/org-manual.org (iCalendar Export): Add an example in the manual.

Reported-by: Hanno Perrey <hanno@hoowl.se>
Link: https://orgmode.org/list/87o821dv7o.fsf@localhost
This commit is contained in:
Ihor Radchenko 2024-01-22 12:12:16 +01:00
parent 46b9769a02
commit 8ec89c53ca
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
3 changed files with 49 additions and 8 deletions

View File

@ -16333,6 +16333,18 @@ when exporting. To force the backend to inherit the =LOCATION=,
=TIMEZONE= and =CLASS= properties, configure the
~org-use-property-inheritance~ variable.
=SUMMARY=, =LOCATION=, and =DESCRIPTION= properties can define
multi-line summary, location, or description using =<PROPERTY>+=
syntax (see [[*Property Syntax]]):
: * Meeting at location with multi-line address
: <2024-01-08 Mon 14:20-15:00>
: :PROPERTIES:
: :LOCATION: Someplace
: :LOCATION+: Some Street 5
: :LOCATION+: 12345 Small Town
: :END:
#+vindex: org-icalendar-include-body
When Org entries do not have =SUMMARY=, =DESCRIPTION=, =LOCATION= and
=CLASS= properties, the iCalendar export backend derives the summary

View File

@ -13,6 +13,32 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
* Version 9.7 (not released yet)
** Important announcements and breaking changes
*** iCalendar export now supports multiline =SUMMARY=, =LOCATION=, and =DESCRIPTION= properties
Previously, it was not possible to specify multi-line location,
summary, or description when exporting to iCalendar.
In the following example, =LOCATION= was exported as "Someplace",
ignoring the other lines.
#+begin_src org
,* heading with multi-line property
:PROPERTIES:
:LOCATION: Someplace
:LOCATION+: Some Street 5
:LOCATION+: 12345 Small Town
:END:
#+end_src
Now, =SUMMARY+=, =LOCATION+=, and =DESCRIPTION+= properties can be
used to create multi-line values.
In the above example, =LOCATION= is now exported as
: Someplace
: Some Street 5
: 12345 Small Town
*** Org mode no longer disallows configuring ~display-buffer-alist~ to open Org popups in other frame
Previously, Org mode disallowed pop-up frames when displaying dispatch buffers.

View File

@ -643,13 +643,15 @@ inlinetask within the section."
(let ((todo-type (org-element-property :todo-type entry))
(uid (or (org-element-property :ID entry) (org-id-new)))
(summary (org-icalendar-cleanup-string
(or (org-element-property :SUMMARY entry)
(org-export-data
(org-element-property :title entry) info))))
(loc (org-icalendar-cleanup-string
(org-export-get-node-property
:LOCATION entry
(org-property-inherit-p "LOCATION"))))
(or
(let ((org-property-separators '(("SUMMARY" . "\n"))))
(org-entry-get entry "SUMMARY" 'selective))
(org-export-data
(org-element-property :title entry) info))))
(loc
(let ((org-property-separators '(("LOCATION" . "\n"))))
(org-icalendar-cleanup-string
(org-entry-get entry "LOCATION" 'selective))))
(class (org-icalendar-cleanup-string
(org-export-get-node-property
:CLASS entry
@ -658,7 +660,8 @@ inlinetask within the section."
;; (headline) or contents (inlinetask).
(desc
(org-icalendar-cleanup-string
(or (org-element-property :DESCRIPTION entry)
(or (let ((org-property-separators '(("DESCRIPTION" . "\n"))))
(org-entry-get entry "DESCRIPTION" 'selective))
(let ((contents (org-export-data inside info)))
(cond
((not (org-string-nw-p contents)) nil)