Next: , Previous: Standard Parse and Suicide Functions, Up: Functions for Writing New Overlay Classes


4.3.2 Functions for Modifying Overlays

These functions modify auto-overlays and match overlays as necessary to perform a particular update. They should always be used to carry out their corresponding tasks, rather than doing it separately, since these tasks require interaction with the core of the auto-overlays package.

(auto-o-update-exclusive set-id beg end old-priority new-priority)
Update the region between beg and end in the current buffer as necessary due to the priority of an exclusive overlay overlapping the region changing from old-priority to new-priority. If the exclusive overlay did not previously overlap the region, old-priority should be null. If it no longer overlaps the region, new-priority should be null. (If both are null, nothing will happen!) The return value is meaningless.
(auto-o-match-overlay overlay start @optional end no-props no-parse protect-match)
Match or unmatch the start and end of the auto-overlay overlay, update all appropriate properties (such as parent, start and end properties, and any properties specified in regexp definitions), and update other auto-overlays in the region covered by overlay if required because the exclusive or priority properties of overlay have changed.

If start or end are match overlays, match the corresponding edge of overlay. The edge is moved to the location defined by the match overlay, and the parent property of the match overlay and the start and end properties of overlay are updated accordingly. The start argument should be a match overlay corresponding either to the unique regexp if only one is needed for that overlay class, or to a start regexp if the overlay class uses separate start and end regexps. The end argument should then be a match overlay corresponding to an end regexp in such a class (see Overview). You're responsible for enforcing this; no check is made.

If start or end are numbers or markers, move the corresponding edge of overlay to that location and set it as unmatched. The start or end property of overlay and the parent property of any corresponding match overlay are set to nil). If start or end are non-nil but neither of the above, leave the corresponding edge of overlay where it is, but set it unmatched (as described above). If start or end are null, don't change the corresponding edge. However, for convenience, if end is null but start is a match overlay corresponding to a match for an end-regexp, match the end of overlay rather than the start.

The remaining arguments disable some of the tasks normally carried out by auto-o-match-overlay. If no-props is non-nil, overlay properties specified in regexp definitions are ignored and not updated. If no-parse is non-nil, auto-overlays in the region covered by overlay are not updated, even if the exclusive or priority properties of overlay have changed. If protect-match is non-nil, the parent properties of the start and end match overlays are left alone.

(auto-o-delete-overlay overlay @optional no-parse protect-match)
Delete auto-overlay overlay from the buffer, and update overlays and overlay properties as necessary. The optional arguments disable parts of the updating process, as for auto-o-match-overlay, above.