From 3ece337ad9ed67592697d94c28160199890a59d3 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Fri, 14 May 1993 22:57:10 +0000 Subject: [PATCH] * 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. --- src/buffer.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index d56ddad7ac..2104226b33 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1506,7 +1506,9 @@ BEG and END may be integers or markers.") DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, "Set the endpoints of OVERLAY to BEG and END in BUFFER.\n\ -If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.") +If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.\n\ +If BUFFER is omitted, and OVERLAY is in no buffer, put it in the current\n\ +buffer.") (overlay, beg, end, buffer) Lisp_Object overlay, beg, end, buffer; { @@ -1515,6 +1517,8 @@ If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.") CHECK_OVERLAY (overlay, 0); if (NILP (buffer)) buffer = Fmarker_buffer (OVERLAY_START (overlay)); + if (NILP (buffer)) + XSET (buffer, Lisp_Buffer, current_buffer); CHECK_BUFFER (buffer, 3); CHECK_NUMBER_COERCE_MARKER (beg, 1); CHECK_NUMBER_COERCE_MARKER (end, 1); @@ -1581,13 +1585,13 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, b->overlays_before = Fdelq (overlay, b->overlays_before); b->overlays_after = Fdelq (overlay, b->overlays_after); - Fset_marker (OVERLAY_START (overlay), 1, Qnil); - Fset_marker (OVERLAY_END (overlay), 1, Qnil); - redisplay_region (b, OVERLAY_POSITION (OVERLAY_START (overlay)), OVERLAY_POSITION (OVERLAY_END (overlay))); + Fset_marker (OVERLAY_START (overlay), Qnil, Qnil); + Fset_marker (OVERLAY_END (overlay), Qnil, Qnil); + return Qnil; } -- 2.20.1