From f6b2ced66e85ed29b03e2c7ad75fa3bd37da22c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Cadilhac?= Date: Thu, 7 Feb 2019 14:09:07 +0000 Subject: [PATCH 5/6] Give more options for using tags in summary. --- doc/org-manual.org | 5 ++++- lisp/ox-icalendar.el | 20 +++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 25d315654..5ad57d3a9 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -15054,11 +15054,14 @@ entry. Consult the ~org-icalendar-use-deadline~ and #+vindex: org-icalendar-categories #+vindex: org-icalendar-alarm-time +#+vindex: org-icalendar-summary-uses-tags For tags on the headline, the iCalendar export back-end makes them into iCalendar categories. To tweak the inheritance of tags and TODO states, configure the variable ~org-icalendar-categories~. To assign clock alarms based on time, configure the ~org-icalendar-alarm-time~ -variable. +variable. Additionally, the variable +~org-icalendar-summary-uses-tags~ can be configured to have tags +appear in the title of the event, when SUMMARY is not provided. #+vindex: org-icalendar-store-UID #+cindex: @samp{ID}, property diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index 4c9bd8340..a34904101 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -120,10 +120,17 @@ This is a list with possibly several symbols in it. Valid symbols are: todo-start))) (defcustom org-icalendar-summary-uses-tags nil - "Non-nil means that TITLE+TAGS is used when SUMMARY is not provided. -If nil, then TITLE is used alone." + "Whether tags should be added to the title to create the summary. + +If a SUMMARY is provided in the entry, this is irrelevant. +If non-nil, it can be set to `local-tags' or `all-tags' indicating which tags +are used to make up the summary: only tags defined in the current line or all +tags including inherited ones, respectively." :group 'org-export-icalendar - :type 'boolean) + :type '(choice + (const :tag "Use the tags defined in current line" local-tags) + (const :tag "Use all tags, including inherited ones" all-tags) + (const :tag "Do not use tags in summary" nil))) (defcustom org-icalendar-bump-todos nil "Non-nil means that pending TODO VEVENTs are bumped to today. @@ -607,8 +614,11 @@ inlinetask within the section." (when (and org-icalendar-summary-uses-tags (not (org-element-property :SUMMARY entry))) (let ((tags (apply 'concat - (mapcar (lambda (x) (concat ":" x)) - (org-export-get-tags entry info nil t))))) + (mapcar + (lambda (x) (concat ":" x)) + (org-export-get-tags + entry info nil + (eq org-icalendar-summary-uses-tags 'all-tags)))))) (when tags (setq summary (concat summary " " tags ":"))))) (concat -- 2.19.2