Function: icalendar--read-element
icalendar--read-element is a byte-compiled function defined in
icalendar.el.gz.
Signature
(icalendar--read-element INVALUE INPARAMS)
Documentation
Recursively read the next iCalendar element in the current buffer.
INVALUE gives the current iCalendar element we are reading.
INPARAMS gives the current parameters.....
This function calls itself recursively for each nested calendar element
it finds. The current buffer should be an unfolded buffer as returned
from icalendar--get-unfolded-buffer.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/icalendar.el.gz
(defun icalendar--read-element (invalue inparams)
"Recursively read the next iCalendar element in the current buffer.
INVALUE gives the current iCalendar element we are reading.
INPARAMS gives the current parameters.....
This function calls itself recursively for each nested calendar element
it finds. The current buffer should be an unfolded buffer as returned
from `icalendar--get-unfolded-buffer'."
(let (element children line name params param param-name param-value
value
(continue t))
(setq children '())
(while (and continue
(re-search-forward "^\\([A-Za-z0-9-]+\\)[;:]" nil t))
(setq name (intern (match-string 1)))
(backward-char 1)
(setq params '())
(setq line '())
(while (looking-at ";")
(re-search-forward ";\\([A-Za-z0-9-]+\\)=" nil nil)
(setq param-name (intern (match-string 1)))
(re-search-forward "\\(\\([^;,:\"]+\\)\\|\"\\([^\"]+\\)\"\\)[;:]"
nil t)
(backward-char 1)
(setq param-value (or (match-string 2) (match-string 3)))
(setq param (list param-name param-value))
(while (looking-at ",")
(re-search-forward "\\(\\([^;,:]+\\)\\|\"\\([^\"]+\\)\"\\)"
nil t)
(if (match-string 2)
(setq param-value (match-string 2))
(setq param-value (match-string 3)))
(setq param (append param param-value)))
(setq params (append params param)))
(unless (looking-at ":")
(error "Oops"))
(forward-char 1)
(let ((start (point)))
(end-of-line)
(setq value (buffer-substring start (point))))
(setq line (list name params value))
(cond ((eq name 'BEGIN)
(setq children
(append children
(list (icalendar--read-element (intern value)
params)))))
((eq name 'END)
(setq continue nil))
(t
(setq element (append element (list line))))))
(if invalue
(list invalue inparams element children)
children)))