Function: icalendar-print-property-node

icalendar-print-property-node is a byte-compiled function defined in icalendar-parser.el.gz.

Signature

(icalendar-print-property-node NODE)

Documentation

Serialize a property syntax node NODE to a string.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-parser.el.gz
(defun ical:print-property-node (node)
  "Serialize a property syntax node NODE to a string."
  (setq node (ical:maybe-add-value-param node))
  (let* ((type (ical:ast-node-type node))
         (list-sep (get type 'ical:list-sep))
         (property-name (car (rassq type ical:property-types)))
         (name-str (or property-name
                       (ical:ast-node-meta-get :original-name node)))
         (params (ical:ast-node-children node))
         (value (ical:ast-node-value node))
         (value-str
          (or (ical:ast-node-meta-get :original-value node)
              ;; any ical:print-error here propagates:
              (if list-sep
                  (string-join (mapcar #'ical:default-value-printer value)
                               list-sep)
                (ical:default-value-printer value)))))

    (unless (and (stringp name-str) (length> name-str 0))
      (ical:signal-print-error
       (format "Unknown property name for type `%s'" type)
       :node node))

    (concat name-str
            (ical:print-params params)
            ":"
            value-str
            "\n")))