diff options
| author | Jim Blandy | 1993-05-14 22:57:10 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-05-14 22:57:10 +0000 |
| commit | 3ece337ad9ed67592697d94c28160199890a59d3 (patch) | |
| tree | af5476b84a80d001f06acc8f2f46fae739e08cf5 /src/buffer.c | |
| parent | 926a64aa20421cd96161cdb85de9ab23ce002b83 (diff) | |
| download | emacs-3ece337ad9ed67592697d94c28160199890a59d3.tar.gz emacs-3ece337ad9ed67592697d94c28160199890a59d3.zip | |
* buffer.c (Fmove_overlay): If the overlay is in no buffer and the
BUFFER argument has been omitted, put it in the current buffer,
for symmetry with move-marker.
* buffer.c (Fdelete_overlay): Make the overlay's markers point
nowhere, not at 1. Do this after calling redisplay_region, so
that code knows what section has changed.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c index d56ddad7aca..2104226b338 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1506,7 +1506,9 @@ BEG and END may be integers or markers.") | |||
| 1506 | 1506 | ||
| 1507 | DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, | 1507 | DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, |
| 1508 | "Set the endpoints of OVERLAY to BEG and END in BUFFER.\n\ | 1508 | "Set the endpoints of OVERLAY to BEG and END in BUFFER.\n\ |
| 1509 | If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.") | 1509 | If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.\n\ |
| 1510 | If BUFFER is omitted, and OVERLAY is in no buffer, put it in the current\n\ | ||
| 1511 | buffer.") | ||
| 1510 | (overlay, beg, end, buffer) | 1512 | (overlay, beg, end, buffer) |
| 1511 | Lisp_Object overlay, beg, end, buffer; | 1513 | Lisp_Object overlay, beg, end, buffer; |
| 1512 | { | 1514 | { |
| @@ -1515,6 +1517,8 @@ If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.") | |||
| 1515 | CHECK_OVERLAY (overlay, 0); | 1517 | CHECK_OVERLAY (overlay, 0); |
| 1516 | if (NILP (buffer)) | 1518 | if (NILP (buffer)) |
| 1517 | buffer = Fmarker_buffer (OVERLAY_START (overlay)); | 1519 | buffer = Fmarker_buffer (OVERLAY_START (overlay)); |
| 1520 | if (NILP (buffer)) | ||
| 1521 | XSET (buffer, Lisp_Buffer, current_buffer); | ||
| 1518 | CHECK_BUFFER (buffer, 3); | 1522 | CHECK_BUFFER (buffer, 3); |
| 1519 | CHECK_NUMBER_COERCE_MARKER (beg, 1); | 1523 | CHECK_NUMBER_COERCE_MARKER (beg, 1); |
| 1520 | CHECK_NUMBER_COERCE_MARKER (end, 1); | 1524 | CHECK_NUMBER_COERCE_MARKER (end, 1); |
| @@ -1581,13 +1585,13 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, | |||
| 1581 | b->overlays_before = Fdelq (overlay, b->overlays_before); | 1585 | b->overlays_before = Fdelq (overlay, b->overlays_before); |
| 1582 | b->overlays_after = Fdelq (overlay, b->overlays_after); | 1586 | b->overlays_after = Fdelq (overlay, b->overlays_after); |
| 1583 | 1587 | ||
| 1584 | Fset_marker (OVERLAY_START (overlay), 1, Qnil); | ||
| 1585 | Fset_marker (OVERLAY_END (overlay), 1, Qnil); | ||
| 1586 | |||
| 1587 | redisplay_region (b, | 1588 | redisplay_region (b, |
| 1588 | OVERLAY_POSITION (OVERLAY_START (overlay)), | 1589 | OVERLAY_POSITION (OVERLAY_START (overlay)), |
| 1589 | OVERLAY_POSITION (OVERLAY_END (overlay))); | 1590 | OVERLAY_POSITION (OVERLAY_END (overlay))); |
| 1590 | 1591 | ||
| 1592 | Fset_marker (OVERLAY_START (overlay), Qnil, Qnil); | ||
| 1593 | Fset_marker (OVERLAY_END (overlay), Qnil, Qnil); | ||
| 1594 | |||
| 1591 | return Qnil; | 1595 | return Qnil; |
| 1592 | } | 1596 | } |
| 1593 | 1597 | ||