From 1c30be14e2e7a6774d499388ec207b1950963746 Mon Sep 17 00:00:00 2001 From: Mikhail Skorzhinskii Date: Sat, 12 Sep 2020 18:27:23 +0200 Subject: [PATCH 2/3] ox-icalendar.el: allow to customise deadline and scheduled items summary In some of export schemes these cookies at the start of each event can be a distraction rather then storage of useful information. --- etc/ORG-NEWS | 5 +++++ lisp/ox-icalendar.el | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 32f64d84e..b912e807d 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -18,6 +18,11 @@ When set to 'title, will show document title in outline path in echo area instead of file name. When set to nil will show only outline path. +*** New options ~org-icalendar-scheduled-summary-prepend~ and ~org-icalendar-deadline-summary-prepend~ + +Through these new options for icalendar export, one can customise the +looks of summary lines in exported events. + * Version 9.4 ** Incompatible changes *** Possibly broken internal file links: please check and fix diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index 0f890534a..f110a4b2b 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -82,6 +82,12 @@ keyword." :group 'org-export-icalendar :type '(repeat (string :tag "Tag"))) +(defcustom org-icalendar-scheduled-summary-prepend "S: " + "String used for prepending summary in exported scheduled headlines.") + +(defcustom org-icalendar-deadline-summary-prepend "DL: " + "String used for prepending summary in exported deadlines.") + (defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due) "Contexts where iCalendar export should use a deadline time stamp. @@ -606,7 +612,7 @@ inlinetask within the section." (_ (memq 'event-if-not-todo use-deadline))) (org-icalendar--vevent entry deadline (concat "DL-" uid) - (concat "DL: " summary) loc desc cat tz class))) + (concat org-icalendar-deadline-summary-prepend summary) loc desc cat tz class))) (let ((scheduled (org-element-property :scheduled entry)) (use-scheduled (plist-get info :icalendar-use-scheduled))) (and scheduled @@ -617,7 +623,7 @@ inlinetask within the section." (_ (memq 'event-if-not-todo use-scheduled))) (org-icalendar--vevent entry scheduled (concat "SC-" uid) - (concat "S: " summary) loc desc cat tz class))) + (concat org-icalendar-scheduled-summary-prepend summary) loc desc cat tz class))) ;; When collecting plain timestamps from a headline and its ;; title, skip inlinetasks since collection will happen once ;; ENTRY is one of them. -- 2.28.0