Function: org-icalendar--valarm

org-icalendar--valarm is a byte-compiled function defined in ox-icalendar.el.gz.

Signature

(org-icalendar--valarm ENTRY TIMESTAMP SUMMARY)

Documentation

Create a VALARM component.

ENTRY is the calendar entry triggering the alarm. TIMESTAMP is the start date-time of the entry. SUMMARY defines a short summary or subject for the task.

Return VALARM component as a string, or nil if it isn't allowed.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-icalendar.el.gz
(defun org-icalendar--valarm (entry timestamp summary)
  "Create a VALARM component.

ENTRY is the calendar entry triggering the alarm.  TIMESTAMP is
the start date-time of the entry.  SUMMARY defines a short
summary or subject for the task.

Return VALARM component as a string, or nil if it isn't allowed."
  ;; Create a VALARM entry if the entry is timed.  This is not very
  ;; general in that:
  ;; (a) only one alarm per entry is defined,
  ;; (b) only minutes are allowed for the trigger period ahead of the
  ;;     start time,
  ;; (c) only a DISPLAY action is defined.                       [ESF]
  (let ((alarm-time
	 (let ((warntime
		(org-element-property :APPT_WARNTIME entry)))
	   (if warntime (string-to-number warntime) nil))))
    (and (or (and alarm-time
		  (> alarm-time 0))
	     (> org-icalendar-alarm-time 0)
	     org-icalendar-force-alarm)
	 (org-element-property :hour-start timestamp)
	 (format "BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:%s
TRIGGER:-P0DT0H%dM0S
END:VALARM\n"
		 summary
                 (cond
                  ((and alarm-time org-icalendar-force-alarm) alarm-time)
                  ((and alarm-time (not (zerop alarm-time))) alarm-time)
                  (t org-icalendar-alarm-time))))))