Commit 13c379ee authored by Paul Eggert's avatar Paul Eggert
Browse files

Do not avoid creating empty evaporating overlays (Bug#9642).

* buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
That is, do not delete an evaporating overlay if it becomes
empty after its bounds are adjusted to fit within its buffer.
This fix caused other problems, and I'm reverting it until we get
to the bottom of them.
parent 8b6c19f4
2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
Do not avoid creating empty evaporating overlays (Bug#9642).
* buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
That is, do not delete an evaporating overlay if it becomes
empty after its bounds are adjusted to fit within its buffer.
This fix caused other problems, and I'm reverting it until we get
to the bottom of them.
2012-04-27 Chong Yidong <cyd@gnu.org>
* xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
......
......@@ -3682,7 +3682,6 @@ buffer. */)
struct buffer *b, *ob;
Lisp_Object obuffer;
int count = SPECPDL_INDEX ();
ptrdiff_t n_beg, n_end;
CHECK_OVERLAY (overlay);
if (NILP (buffer))
......@@ -3701,23 +3700,15 @@ buffer. */)
CHECK_NUMBER_COERCE_MARKER (beg);
CHECK_NUMBER_COERCE_MARKER (end);
if (XINT (beg) == XINT (end) && ! NILP (Foverlay_get (overlay, Qevaporate)))
return Fdelete_overlay (overlay);
if (XINT (beg) > XINT (end))
{
Lisp_Object temp;
temp = beg; beg = end; end = temp;
}
/* First set the overlay boundaries, which may clip them. */
Fset_marker (OVERLAY_START (overlay), beg, buffer);
Fset_marker (OVERLAY_END (overlay), end, buffer);
n_beg = marker_position (OVERLAY_START (overlay));
n_end = marker_position (OVERLAY_END (overlay));
/* Now, delete the overlay if it is empty after clipping and has the
evaporate property. */
if (n_beg == n_end && ! NILP (Foverlay_get (overlay, Qevaporate)))
return Fdelete_overlay (overlay);
specbind (Qinhibit_quit, Qt);
obuffer = Fmarker_buffer (OVERLAY_START (overlay));
......@@ -3740,7 +3731,7 @@ buffer. */)
}
/* Redisplay where the overlay is going to be. */
modify_overlay (b, n_beg, n_end);
modify_overlay (b, XINT (beg), XINT (end));
}
else
/* Redisplay the area the overlay has just left, or just enclosed. */
......@@ -3750,12 +3741,16 @@ buffer. */)
o_beg = OVERLAY_POSITION (OVERLAY_START (overlay));
o_end = OVERLAY_POSITION (OVERLAY_END (overlay));
if (o_beg == n_beg)
modify_overlay (b, o_end, n_end);
else if (o_end == n_end)
modify_overlay (b, o_beg, n_beg);
if (o_beg == XINT (beg))
modify_overlay (b, o_end, XINT (end));
else if (o_end == XINT (end))
modify_overlay (b, o_beg, XINT (beg));
else
modify_overlay (b, min (o_beg, n_beg), max (o_end, n_end));
{
if (XINT (beg) < o_beg) o_beg = XINT (beg);
if (XINT (end) > o_end) o_end = XINT (end);
modify_overlay (b, o_beg, o_end);
}
}
if (!NILP (obuffer))
......@@ -3767,8 +3762,12 @@ buffer. */)
eassert (XOVERLAY (overlay)->next == NULL);
}
Fset_marker (OVERLAY_START (overlay), beg, buffer);
Fset_marker (OVERLAY_END (overlay), end, buffer);
/* Put the overlay on the wrong list. */
if (n_end < b->overlay_center)
end = OVERLAY_END (overlay);
if (OVERLAY_POSITION (end) < b->overlay_center)
{
XOVERLAY (overlay)->next = b->overlays_after;
b->overlays_after = XOVERLAY (overlay);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment