Function: icalendar-read-property-value

icalendar-read-property-value is a byte-compiled function defined in icalendar-parser.el.gz.

Signature

(icalendar-read-property-value TYPE S &optional PARAMS)

Documentation

Read a value for the property type TYPE from a string S.

TYPE should be a type symbol for an iCalendar property type defined with icalendar-define-property. The property value is assumed to be of TYPE's default value type, unless an icalendar-valuetypeparam parameter appears in PARAMS, in which case a value of that type will be read. S should have already been matched against TYPE's value regex and the match data should be available to this function. Returns a property syntax node of type TYPE containing the read value and the list of PARAMS.

If TYPE accepts lists of values, they will be split from S on the list separator and read separately.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-parser.el.gz
(defun ical:read-property-value (type s &optional params)
  "Read a value for the property type TYPE from a string S.

TYPE should be a type symbol for an iCalendar property type
defined with `icalendar-define-property'.  The property value is
assumed to be of TYPE's default value type, unless an
`icalendar-valuetypeparam' parameter appears in PARAMS, in which
case a value of that type will be read.  S should have already
been matched against TYPE's value regex and the match data should
be available to this function.  Returns a property syntax node of
type TYPE containing the read value and the list of PARAMS.

If TYPE accepts lists of values, they will be split from S on the
list separator and read separately."
  (let* ((value-type (or (ical:value-type-from-params params)
                         (get type 'ical:default-type)))
         (list-sep (get type 'ical:list-sep))
         (unrecognized-val (match-string 5))
         (raw-val (if unrecognized-val
                      (get type 'ical:substitute-value)
                    s))
         (value (if list-sep
                    (ical:read-list-of value-type raw-val list-sep)
                  (ical:read-value-node value-type raw-val))))
    (ical:make-ast-node type
                        (list :value value
                              :original-value unrecognized-val)
                        params)))