Function: icalendar-parse-params

icalendar-parse-params is a byte-compiled function defined in icalendar-parser.el.gz.

Signature

(icalendar-parse-params LIMIT)

Documentation

Parse the parameter string of the current property, up to LIMIT.

Point should be at the ";" at the start of the first parameter. Returns a list of parameters, which may be nil if none are present. After parsing, point is at the end of the parameter string and the start of the property value string.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-parser.el.gz
(defun ical:parse-params (limit)
  "Parse the parameter string of the current property, up to LIMIT.
Point should be at the \";\" at the start of the first parameter.
Returns a list of parameters, which may be nil if none are present.
After parsing, point is at the end of the parameter string and the
start of the property value string."
  (let (params param-node)
    (rx-let ((ical:param-start (seq ";" (group-n 1 ical:param-name) "=")))
      (while (re-search-forward (rx ical:param-start) limit t)
        (when-let* ((begin (match-beginning 1))
                    (param-name (match-string 1))
                    (param-type (alist-get (upcase param-name)
                                           ical:param-types
                                           'ical:otherparam
                                            nil #'equal)))
          (condition-case err
              (setq param-node (ical:parse-param-value param-type limit))
            (ical:parse-error
             (ical:handle-parse-error err (format "Skipping bad %s parameter"
                                                  param-name))
             (setq param-node nil)))
          (when param-node
            (ical:ast-node-meta-set param-node :begin begin)
            ;; store the original param name if we didn't recognize it:
            (when (eq param-type 'ical:otherparam)
              (ical:ast-node-meta-set param-node :original-name param-name))
            (push param-node params))))
    (nreverse params))))