Function: icalendar-make-ast-node

icalendar-make-ast-node is a byte-compiled function defined in icalendar-ast.el.gz.

Signature

(icalendar-make-ast-node TYPE PROPS &optional CHILDREN)

Documentation

Construct a syntax node of TYPE with meta-properties PROPS and CHILDREN.

This is a low-level constructor. If you are constructing iCalendar syntax nodes directly in Lisp code, consider using one of the higher-level macros based on icalendar-make-node-from-templates instead, which expand to calls to this function but also perform type checking and validation.

TYPE should be an iCalendar type symbol. CHILDREN, if given, should be a list of syntax nodes. In property nodes, these should be the parameters of the property. In component nodes, these should be the properties or subcomponents of the component. CHILDREN should otherwise be nil.

PROPS should be a plist with any of the following keywords:

:value - in value nodes, this should be the Elisp value parsed from a
  property or parameter's value string. In parameter and property nodes,
  this should be a value node or list of value nodes. In component
  nodes, it should not be present.
:buffer - buffer from which VALUE was parsed
:begin - position at which this node begins in BUFFER
:end - position at which this node ends in BUFFER
:value-begin - position at which VALUE begins in BUFFER
:value-end - position at which VALUE ends in BUFFER
:original-value - a string containing the original, uninterpreted value
  of the node. This can differ from (a string represented by) VALUE
  if e.g. a default VALUE was substituted for an unrecognized but
  syntactically correct value.
:original-name - a string containing the original, uninterpreted name
  of the parameter, property or component this node represents.
  This can differ from (a string representing) TYPE
  if e.g. a default TYPE was substituted for an unrecognized but
  syntactically correct one.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-ast.el.gz
(defun ical:make-ast-node (type props &optional children)
  "Construct a syntax node of TYPE with meta-properties PROPS and CHILDREN.

This is a low-level constructor.  If you are constructing iCalendar
syntax nodes directly in Lisp code, consider using one of the
higher-level macros based on `icalendar-make-node-from-templates'
instead, which expand to calls to this function but also perform type
checking and validation.

TYPE should be an iCalendar type symbol.  CHILDREN, if given, should be
a list of syntax nodes.  In property nodes, these should be the
parameters of the property.  In component nodes, these should be the
properties or subcomponents of the component.  CHILDREN should otherwise
be nil.

PROPS should be a plist with any of the following keywords:

:value - in value nodes, this should be the Elisp value parsed from a
  property or parameter's value string.  In parameter and property nodes,
  this should be a value node or list of value nodes.  In component
  nodes, it should not be present.
:buffer - buffer from which VALUE was parsed
:begin - position at which this node begins in BUFFER
:end - position at which this node ends in BUFFER
:value-begin - position at which VALUE begins in BUFFER
:value-end - position at which VALUE ends in BUFFER
:original-value - a string containing the original, uninterpreted value
  of the node.  This can differ from (a string represented by) VALUE
  if e.g. a default VALUE was substituted for an unrecognized but
  syntactically correct value.
:original-name - a string containing the original, uninterpreted name
  of the parameter, property or component this node represents.
  This can differ from (a string representing) TYPE
  if e.g. a default TYPE was substituted for an unrecognized but
  syntactically correct one."
  ;; automatically mark :value as a "secondary property" for org-element-ast
  (let ((full-props (if (plist-member props :value)
                        (plist-put props :secondary (list :value))
                      props)))
    (apply #'org-element-create type full-props children)))