emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 8ec89c53ca 3/4: ox-icalendar: Add support for multi


From: ELPA Syncer
Subject: [elpa] externals/org 8ec89c53ca 3/4: ox-icalendar: Add support for multi-line SUMMARY, LOCATION, and DESCRIPTION
Date: Thu, 25 Jan 2024 09:58:21 -0500 (EST)

branch: externals/org
commit 8ec89c53ca18549635e94f37c8eb0fe7b543053f
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    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
---
 doc/org-manual.org   | 12 ++++++++++++
 etc/ORG-NEWS         | 26 ++++++++++++++++++++++++++
 lisp/ox-icalendar.el | 19 +++++++++++--------
 3 files changed, 49 insertions(+), 8 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index d8c7fd7377..7e5ac0673f 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -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
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 32dd90f81a..6f94c4877a 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -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.
diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el
index 3dd2c88d86..3ef3f814bf 100644
--- a/lisp/ox-icalendar.el
+++ b/lisp/ox-icalendar.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]