Function: gnus-icalendar-event-reply-from-buffer

gnus-icalendar-event-reply-from-buffer is a byte-compiled function defined in gnus-icalendar.el.gz.

Signature

(gnus-icalendar-event-reply-from-buffer BUF STATUS IDENTITIES &optional COMMENT)

Documentation

Build a calendar event reply for request contained in BUF.

The reply will have STATUS (accepted, tentative or declined).
The reply will be composed for attendees matching any entry on the IDENTITIES list. Optional argument COMMENT will be placed in the comment field of the reply.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-icalendar.el.gz
(defun gnus-icalendar-event-reply-from-buffer (buf status identities &optional comment)
  "Build a calendar event reply for request contained in BUF.
The reply will have STATUS (`accepted', `tentative' or  `declined').
The reply will be composed for attendees matching any entry
on the IDENTITIES list.
Optional argument COMMENT will be placed in the comment field of the
reply.
"
  (cl-labels
      ((extract-block
	(blockname)
	(save-excursion
	  (let ((block-start-re (format "^BEGIN:%s" blockname))
		(block-end-re (format "^END:%s" blockname))
		start)
	    (when (re-search-forward block-start-re nil t)
	      (setq start (line-beginning-position))
	      (re-search-forward block-end-re)
	      (buffer-substring-no-properties start (line-end-position)))))))
    (let (zone event)
      (with-current-buffer (icalendar--get-unfolded-buffer (get-buffer buf))
        (goto-char (point-min))
        (setq zone (extract-block "VTIMEZONE")
              event (extract-block "VEVENT")))

      (when event
        (let ((contents (list "BEGIN:VCALENDAR"
                              "METHOD:REPLY"
                              "PRODID:Gnus"
                              "VERSION:2.0"
                              zone
                              (gnus-icalendar-event--build-reply-event-body event status identities comment)
                              "END:VCALENDAR")))

          (mapconcat #'identity (delq nil contents) "\n"))))))