summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/ORG-NEWS14
-rw-r--r--lisp/ox-icalendar.el2
-rw-r--r--lisp/ox.el2
-rw-r--r--testing/lisp/test-ox-icalendar.el15
4 files changed, 31 insertions, 2 deletions
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 949429308..d8018690f 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -57,6 +57,20 @@ remote resources in the =#+include:='s. Now, an error is thrown to
avoid seemingly ignored =#+include= statements when publishing via
batch scripts.
+*** Diary-style timestamps are exported together with active timestamps
+
+~org-export-with-timestamps~ and ~org-icalendar-with-timestamps~ now
+treat diary-style timestamps as a type of active timestamp for
+purposes of export.
+
+This mainly affects iCalendar export, where diary timestamps will now
+be included when only active timestamps are exported (the default).
+
+This should have minimal impact on non-iCalendar exporters, since
+~org-export-with-timestamps~ was already ~t~ by default. However,
+users who manually set ~org-export-with-timestamps~ to ~active~ will
+now have diary timestamps included as well.
+
** New features
# We list the most important features, and the features that may
diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el
index 858d146d6..e7ca6aafb 100644
--- a/lisp/ox-icalendar.el
+++ b/lisp/ox-icalendar.el
@@ -746,7 +746,7 @@ inlinetask within the section."
(lambda (ts)
(when (let ((type (org-element-property :type ts)))
(cl-case (plist-get info :with-timestamps)
- (active (memq type '(active active-range)))
+ (active (memq type '(active active-range diary)))
(inactive (memq type '(inactive inactive-range)))
((t) t)))
(let ((uid (format "TS%d-%s" (cl-incf counter) uid)))
diff --git a/lisp/ox.el b/lisp/ox.el
index f6846b4e1..9b2005703 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -1860,7 +1860,7 @@ not exported."
(cl-case (plist-get options :with-timestamps)
((nil) t)
(active
- (not (memq (org-element-property :type datum) '(active active-range))))
+ (not (memq (org-element-property :type datum) '(active active-range diary))))
(inactive
(not (memq (org-element-property :type datum)
'(inactive inactive-range)))))))))
diff --git a/testing/lisp/test-ox-icalendar.el b/testing/lisp/test-ox-icalendar.el
index e631b2119..c7c74c526 100644
--- a/testing/lisp/test-ox-icalendar.el
+++ b/testing/lisp/test-ox-icalendar.el
@@ -128,5 +128,20 @@ SCHEDULED: <2023-03-26 Sun .+1m>"
(when (file-exists-p tmp-ics)
(delete-file tmp-ics))))))))
+(ert-deftest test-ox-icalendar/diary-timestamp ()
+ "Test icalendar export of diary timestamps."
+ (let* ((tmp-ics (org-test-with-temp-text-in-file
+ "* First Sunday of the month
+<%%(diary-float t 0 1)>"
+ (expand-file-name (org-icalendar-export-to-ics)))))
+ (unwind-protect
+ (with-temp-buffer
+ (insert-file-contents tmp-ics)
+ (save-excursion
+ (should (search-forward "SUMMARY:First Sunday of the month")))
+ (save-excursion
+ (should (search-forward "RRULE:FREQ=MONTHLY;BYDAY=1SU"))))
+ (when (file-exists-p tmp-ics) (delete-file tmp-ics)))))
+
(provide 'test-ox-icalendar)
;;; test-ox-icalendar.el ends here