A position denotes somewhere in the DOM tree, which can be before or after some node, or between two adjacent nodes.
Positions may become invalid after editing operations. To maintain a valid position across arbitrary editing operations, see Markers.
element denotes the position before the element.(end-pos node) denotes the position at the end of node (after any children).node must be an element.(text-pos node offset) denotes the position before the offset-th character of node. node must be a text-node.nil denotes nowhere. Many position-related functions return nil if requested position does not exist, and propagates nil if they receive nil position as an argument.The following functions query node around a given position. The return value can be a character or element.If no node is found, nil is returned.
node-after (marker-or-pos)node-before (marker-or-pos)node-containing (marker-or-pos)Basic position functions:
pos-left (pos &key destructive)pos-right (pos &key destructive)pos-next (pos &key destructive)pos-prev (pos &key destructive)pos-up (pos)pos-down (pos)pos-down-last (pos)Iterate until or ensure a position predicate is satisfied: pos-*-until, pos-*-ensure
Destructive variants: npos-*
All of the above functions may take and return nil positions without signaling error.
Two positions point to the same location iff they are equalp.
Additional functions for comparing positions:
before-p (pos-1 pos-2)