From 90bce01b8e97943ba90c7a9c720350bc04951a27 Mon Sep 17 00:00:00 2001 From: Mikhail Skorzhinskii Date: Sat, 12 Sep 2020 18:27:23 +0200 Subject: [PATCH 1/2] 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 | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index e30336f45..cc471e20b 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -17,6 +17,11 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org. When set to 'title, will show document title in outline path in echo area instead of file name. +*** 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..39807c7c2 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -82,6 +82,17 @@ 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." + :group 'org-export-icalendar + :type 'string) + + +(defcustom org-icalendar-deadline-summary-prepend "DL: " + "String used for prepending summary in exported deadlines." + :group 'org-export-icalendar + :type 'string) + (defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due) "Contexts where iCalendar export should use a deadline time stamp. @@ -606,7 +617,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 +628,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