- /* -1 means insertions go into before_field, 1 means they go
- into after_field, 0 means neither. */
- int stickiness;
- /* Whether the before/after_field come from overlays. */
- int bop = !NILP (before_overlay);
- int aop = !NILP (after_overlay);
-
- if (bop && XMARKER (OVERLAY_END (before_overlay))->insertion_type == 1)
- /* before_field is from an overlay, which expands upon
- end-insertions. Note that it's possible for after_overlay to
- also eat insertions here, but then they will overlap, and
- there's not much we can do. */
- stickiness = -1;
- else if (aop
- && XMARKER (OVERLAY_START (after_overlay))->insertion_type == 0)
- /* after_field is from an overlay, which expand to contain
- start-insertions. */
- stickiness = 1;
- else if (bop && aop)
- /* Both fields come from overlays, but neither will contain any
- insertion here. */
- stickiness = 0;
- else if (bop)
- /* before_field is an overlay that won't eat any insertion, but
- after_field is from a text-property. Assume that the
- text-property continues underneath the overlay, and so will
- be inherited by any insertion, regardless of any stickiness
- settings. */
- stickiness = 1;
- else if (aop)
- /* Similarly, when after_field is the overlay. */
- stickiness = -1;
- else
- /* Both fields come from text-properties. Look for explicit
- stickiness properties. */
- stickiness = text_property_stickiness (Qfield, pos);
-
- if (stickiness > 0)
- at_field_start = 1;
- else if (stickiness < 0)