Function: gnus-icalendar-event->gnus-calendar

gnus-icalendar-event->gnus-calendar is a byte-compiled function defined in gnus-icalendar.el.gz.

Signature

(gnus-icalendar-event->gnus-calendar ARG &rest ARGS)

Implementations

(gnus-icalendar-event->gnus-calendar (EVENT gnus-icalendar-event) &optional REPLY-STATUS) in `gnus-icalendar.el'.

Format an overview of EVENT details.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-icalendar.el.gz
;; TODO: make the template customizable
(cl-defmethod gnus-icalendar-event->gnus-calendar ((event gnus-icalendar-event) &optional reply-status)
  "Format an overview of EVENT details."
  (cl-labels
      ((format-header (x)
		      (format "%-12s%s"
			      (propertize (concat (car x) ":") 'face 'bold)
			      (cadr x))))

    (with-slots (organizer summary description location recur uid
                           method rsvp participation-type)
        event
      (let ((headers `(("Summary" ,summary)
		       ("Location" ,(or location ""))
		       ("Time" ,(gnus-icalendar-event:org-timestamp event))
		       ("Organizer" ,organizer)
		       ("Attendance" ,(if (eq participation-type 'non-participant)
					  "You are not listed as an attendee"
					(capitalize (symbol-name participation-type))))
		       ("Method" ,method))))

	(when (and (not (gnus-icalendar-event-reply-p event)) rsvp)
	  (setq headers (append headers
				`(("Status" ,(or reply-status "Not replied yet"))))))

	(concat
	 (mapconcat #'format-header headers "\n")
	 "\n\n"
	 description)))))