Given an ibp-line-object and a position within
that line, this function tries to find the field
containing that position.
There are three cases:
If the position is before the line's tail, we return
an ibp-field-object describing the
head.
If the position is within the tail, we return an
ibp-field-object describing whichever
field contains that position.
If the position is past the tail, we
return nil.
This function just checks for the first case. If the
position isn't before the tail, we call Section 5.10, “ibp-bracket-tail-field: What tail field
contains the cursor?”.
;; - - - i b p - b r a c k e t - f i e l d - - -
(defun ibp-bracket-field (line p)
"Find the field containing a position p within an ibp-line-object
[ if (line is a ibp-line-object for a line with a tail)
and (p is a position within line) ->
if p is in the head part of line ->
return an ibp-field-object representing the head part, with
nil filler
else if p is in a tail field of line ->
return an ibp-field-object representing that field
else ->
return nil ]
----------------------------------------------------------------"
(if (< p (ibp-line-tail line))
(ibp-field-object (ibp-line-beg line) (ibp-line-tail line) nil)
(ibp-bracket-tail-field line)))