Function: org-icalendar--vtodo
org-icalendar--vtodo is a byte-compiled function defined in
ox-icalendar.el.gz.
Signature
(org-icalendar--vtodo ENTRY UID SUMMARY LOCATION DESCRIPTION CATEGORIES TIMEZONE CLASS)
Documentation
Create a VTODO component.
ENTRY is either a headline or an inlinetask element. UID is the unique identifier for the task. SUMMARY defines a short summary or subject for the task. LOCATION defines the intended venue for the task. DESCRIPTION provides the complete description of the task. CATEGORIES defines the categories the task belongs to. TIMEZONE specifies a time zone for this TODO only.
Return VTODO component as a string.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ox-icalendar.el.gz
(defun org-icalendar--vtodo
(entry uid summary location description categories timezone class)
"Create a VTODO component.
ENTRY is either a headline or an inlinetask element. UID is the
unique identifier for the task. SUMMARY defines a short summary
or subject for the task. LOCATION defines the intended venue for
the task. DESCRIPTION provides the complete description of the
task. CATEGORIES defines the categories the task belongs to.
TIMEZONE specifies a time zone for this TODO only.
Return VTODO component as a string."
(let ((start (or (and (memq 'todo-start org-icalendar-use-scheduled)
(org-element-property :scheduled entry))
;; If we can't use a scheduled time for some
;; reason, start task now.
(let ((now (decode-time)))
(list 'timestamp
(list :type 'active
:minute-start (nth 1 now)
:hour-start (nth 2 now)
:day-start (nth 3 now)
:month-start (nth 4 now)
:year-start (nth 5 now)))))))
(org-icalendar-fold-string
(concat "BEGIN:VTODO\n"
"UID:TODO-" uid "\n"
(org-icalendar-dtstamp) "\n"
(org-icalendar-convert-timestamp start "DTSTART" nil timezone) "\n"
(and (memq 'todo-due org-icalendar-use-deadline)
(org-element-property :deadline entry)
(concat (org-icalendar-convert-timestamp
(org-element-property :deadline entry) "DUE" nil timezone)
"\n"))
"SUMMARY:" summary "\n"
(and (org-string-nw-p location) (format "LOCATION:%s\n" location))
(and (org-string-nw-p class) (format "CLASS:%s\n" class))
(and (org-string-nw-p description)
(format "DESCRIPTION:%s\n" description))
"CATEGORIES:" categories "\n"
"SEQUENCE:1\n"
(format "PRIORITY:%d\n"
(let ((pri (or (org-element-property :priority entry)
org-priority-default)))
(floor (- 9 (* 8. (/ (float (- org-priority-lowest pri))
(- org-priority-lowest
org-priority-highest)))))))
(format "STATUS:%s\n"
(if (eq (org-element-property :todo-type entry) 'todo)
"NEEDS-ACTION"
"COMPLETED"))
"END:VTODO"))))