#define DE_MUST_BE_ATTACHED 2
Lisp_Object Vlast_highlighted_extent;
-int mouse_highlight_priority;
+Fixnum mouse_highlight_priority;
Lisp_Object Qextentp;
Lisp_Object Qextent_live_p;
Return the next position after POS where an extent begins or ends.
If POS is at the end of the buffer or string, POS will be returned;
otherwise a position greater than POS will always be returned.
-If BUFFER is nil, the current buffer is assumed.
+If OBJECT is nil, the current buffer is assumed.
*/
(pos, object))
{
get_buffer_or_string_range_byte (buffer_or_string, start, end, &s, &e,
GB_ALLOW_PAST_ACCESSIBLE);
+ buffer_or_string_extent_info_force (buffer_or_string);
set_extent_endpoints (ext, s, e, buffer_or_string);
return extent;
}
#endif
/* The extent-adjustment code adjusted the extent's endpoints as if
- they were markers -- endpoints at the gap (i.e. the insertion
- point) go to the left of the insertion point, which is correct
- for [) extents. We need to fix the other kinds of extents.
+ all extents were closed-open -- endpoints at the insertion point
+ remain unchanged. We need to fix the other kinds of extents:
+
+ 1. Start position of start-open extents needs to be moved.
+
+ 2. End position of end-closed extents needs to be moved.
- Note that both conditions below will hold for zero-length (]
- extents at the gap. Zero-length () extents would get adjusted
- such that their start is greater than their end; we treat them
- as [) extents. This is unfortunately an inelegant part of the
- extent model, but there is no way around it. */
+ Note that both conditions hold for zero-length (] extents at the
+ insertion point. But under these rules, zero-length () extents
+ would get adjusted such that their start is greater than their
+ end; instead of allowing that, we treat them as [) extents by
+ modifying condition #1 to not fire nothing when dealing with a
+ zero-length open-open extent.
+
+ Existence of zero-length open-open extents is unfortunately an
+ inelegant part of the extent model, but there is no way around
+ it. */
{
- Memind new_start, new_end;
+ Memind new_start = extent_start (extent);
+ Memind new_end = extent_end (extent);
- new_start = extent_start (extent);
- new_end = extent_end (extent);
- if (indice == extent_start (extent) && extent_start_open_p (extent) &&
- /* coerce zero-length () extents to [) */
- new_start != new_end)
+ if (indice == extent_start (extent) && extent_start_open_p (extent)
+ /* zero-length () extents are exempt; see comment above. */
+ && !(new_start == new_end && extent_end_open_p (extent))
+ )
new_start += closure->length;
if (indice == extent_end (extent) && !extent_end_open_p (extent))
new_end += closure->length;
+
set_extent_endpoints_1 (extent, new_start, new_end);
}
/* Do we need a lisp-level function ? */
DEFUN ("set-extent-initial-redisplay-function", Fset_extent_initial_redisplay_function,
- 2,2,0,/*
+ 2,2,0, /*
Note: This feature is experimental!
Set initial-redisplay-function of EXTENT to the function
DEFUN ("extent-property", Fextent_property, 2, 3, 0, /*
Return EXTENT's value for property PROPERTY.
+If no such property exists, DEFAULT is returned.
See `set-extent-property' for the built-in property names.
*/
(extent, property, default_))
argument OBJECT is the buffer or string to scan (defaults to the current
buffer).
The property values are compared with `eq'.
-Return nil if the property is constant all the way to the end of BUFFER.
+Return nil if the property is constant all the way to the end of OBJECT.
If the value is non-nil, it is a position greater than POS, never equal.
If the optional fourth argument LIMIT is non-nil, don't search
argument OBJECT is the buffer or string to scan (defaults to the current
buffer).
The property values are compared with `eq'.
-Return nil if the property is constant all the way to the start of BUFFER.
+Return nil if the property is constant all the way to the start of OBJECT.
If the value is non-nil, it is a position less than POS, never equal.
If the optional fourth argument LIMIT is non-nil, don't search back