Function: icalendar-with-child-of

icalendar-with-child-of is a macro defined in icalendar-macs.el.gz.

Signature

(icalendar-with-child-of NODE TYPE &optional BINDINGS &rest BODY)

Documentation

Like icalendar-with-node-value, but for the relevant node's parent.

Find the first child node of type TYPE in NODE, bind that child node's value and any of its children in BINDINGS and execute BODY with these bindings. If there is no such node, this form evaluates to nil without executing BODY.

Within BODY, the symbols value-node, value-type, and value will be bound as in icalendar-with-node-value. If BODY is nil, it is assumed to be the symbol value; thus
  (icalendar-with-child-of some-node some-type)
is equivalent to
  (icalendar-with-child-of some-node some-type nil value)

See icalendar-with-node-children for the form of BINDINGS.

Aliases

icalendar-with-property-of

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-macs.el.gz
(defmacro ical:with-child-of (node type &optional bindings &rest body)
  "Like `icalendar-with-node-value', but for the relevant node's parent.

Find the first child node of type TYPE in NODE, bind that
child node's value and any of its children in BINDINGS and execute BODY
with these bindings.  If there is no such node, this form evaluates to
nil without executing BODY.

Within BODY, the symbols `value-node', `value-type', and `value' will be
bound as in `icalendar-with-node-value'.
If BODY is nil, it is assumed to be the symbol `value'; thus
  (icalendar-with-child-of some-node some-type)
is equivalent to
  (icalendar-with-child-of some-node some-type nil value)

See `icalendar-with-node-children' for the form of BINDINGS."
  (declare (debug (form form &optional form &rest form))
           (indent 3))
  (let ((child (gensym "icalendar-node")))
    `(let ((,child (ical:ast-node-first-child-of ,type ,node)))
       (ical:with-node-value ,child ,bindings ,@body))))