0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-20 01:56:29 +00:00

ox-icalendar.el: Customize vevent summary prefix

* lisp/ox-icalendar.el (org-icalendar-scheduled-summary-prefix): A new
customization option to control summary prefix in exported scheduled
events.
* lisp/ox-icalendar.el (org-icalendar-deadline-summary-prefix): A new
customization option to control summary prefix in exported deadline
events.
* lisp/ox-icalendar.el (org-icalendar-entry): Use configurable summary
prefixes for scheduled and deadline events, instead of hardcoded ones.
This commit is contained in:
Mikhail Skorzhinskii 2020-09-12 18:27:23 +02:00 committed by Ihor Radchenko
parent fe90cab956
commit eb5ef0ae14
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B
2 changed files with 26 additions and 2 deletions

View file

@ -295,6 +295,13 @@ Use the header argument =:var x=code-block[]= or
to pass the contents of a named code block as a string argument.
** New options
*** New custom settings =org-icalendar-scheduled-summary-prefix= and =org-icalendar-deadline-summary-prefix=
These settings allow users to define prefixes for exported summary
lines in ICS exports. The customization can be used to disable
the prefixes completely or make them a little bit more verbose
(e.g. "Deadline: " instead of the default "DL: ").
*** A new custom setting =org-hide-drawer-startup= to control initial folding state of drawers
Previously, all the drawers were always folded when opening an Org

View file

@ -101,6 +101,21 @@ keyword."
:group 'org-export-icalendar
:type '(repeat (string :tag "Tag")))
(defcustom org-icalendar-scheduled-summary-prefix "S: "
"String prepended to exported scheduled headlines."
:group 'org-export-icalendar
:type 'string
:package-version '(Org . "9.6")
:safe #'stringp)
(defcustom org-icalendar-deadline-summary-prefix "DL: "
"String prepended to exported headlines with a deadline."
:group 'org-export-icalendar
:type 'string
:package-version '(Org . "9.6")
:safe #'stringp)
(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due)
"Contexts where iCalendar export should use a deadline time stamp.
@ -624,7 +639,8 @@ 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-prefix summary)
loc desc cat tz class)))
(let ((scheduled (org-element-property :scheduled entry))
(use-scheduled (plist-get info :icalendar-use-scheduled)))
(and scheduled
@ -635,7 +651,8 @@ 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-prefix 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.