diff options
| author | Paul Eggert | 2012-05-25 13:30:19 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-05-25 13:30:19 -0700 |
| commit | 024811862b8929f91fcaac280eaac8dd8719e7e1 (patch) | |
| tree | 48b2ecd7061fe3963ce5773d4e2307e8496c981a /src/buffer.c | |
| parent | 23d10a2703c40fc6676a74a249f266942627225e (diff) | |
| download | emacs-024811862b8929f91fcaac280eaac8dd8719e7e1.tar.gz emacs-024811862b8929f91fcaac280eaac8dd8719e7e1.zip | |
* src/buffer.c (Fmove_overflay): Clip instead of trying to fix bug 9642.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/buffer.c b/src/buffer.c index dbaa9f0cc82..5d431f21a70 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -3697,21 +3697,18 @@ buffer. */) | |||
| 3697 | 3697 | ||
| 3698 | CHECK_NUMBER_COERCE_MARKER (beg); | 3698 | CHECK_NUMBER_COERCE_MARKER (beg); |
| 3699 | CHECK_NUMBER_COERCE_MARKER (end); | 3699 | CHECK_NUMBER_COERCE_MARKER (end); |
| 3700 | 3700 | n_beg = clip_to_bounds (PTRDIFF_MIN, XINT (beg), PTRDIFF_MAX); | |
| 3701 | if (XINT (beg) > XINT (end)) | 3701 | n_end = clip_to_bounds (PTRDIFF_MIN, XINT (end), PTRDIFF_MAX); |
| 3702 | { | ||
| 3703 | Lisp_Object temp; | ||
| 3704 | temp = beg; beg = end; end = temp; | ||
| 3705 | } | ||
| 3706 | |||
| 3707 | Fset_marker (OVERLAY_START (overlay), beg, buffer); | ||
| 3708 | Fset_marker (OVERLAY_END (overlay), end, buffer); | ||
| 3709 | n_beg = marker_position (OVERLAY_START (overlay)); | ||
| 3710 | n_end = marker_position (OVERLAY_END (overlay)); | ||
| 3711 | 3702 | ||
| 3712 | if (n_beg == n_end && ! NILP (Foverlay_get (overlay, Qevaporate))) | 3703 | if (n_beg == n_end && ! NILP (Foverlay_get (overlay, Qevaporate))) |
| 3713 | return Fdelete_overlay (overlay); | 3704 | return Fdelete_overlay (overlay); |
| 3714 | 3705 | ||
| 3706 | if (n_beg > n_end) | ||
| 3707 | { | ||
| 3708 | ptrdiff_t temp; | ||
| 3709 | temp = n_beg; n_beg = n_end; n_end = temp; | ||
| 3710 | } | ||
| 3711 | |||
| 3715 | specbind (Qinhibit_quit, Qt); | 3712 | specbind (Qinhibit_quit, Qt); |
| 3716 | 3713 | ||
| 3717 | obuffer = Fmarker_buffer (OVERLAY_START (overlay)); | 3714 | obuffer = Fmarker_buffer (OVERLAY_START (overlay)); |
| @@ -3761,8 +3758,12 @@ buffer. */) | |||
| 3761 | eassert (XOVERLAY (overlay)->next == NULL); | 3758 | eassert (XOVERLAY (overlay)->next == NULL); |
| 3762 | } | 3759 | } |
| 3763 | 3760 | ||
| 3761 | Fset_marker (OVERLAY_START (overlay), beg, buffer); | ||
| 3762 | Fset_marker (OVERLAY_END (overlay), end, buffer); | ||
| 3763 | |||
| 3764 | /* Put the overlay on the wrong list. */ | 3764 | /* Put the overlay on the wrong list. */ |
| 3765 | if (n_end < b->overlay_center) | 3765 | end = OVERLAY_END (overlay); |
| 3766 | if (OVERLAY_POSITION (end) < b->overlay_center) | ||
| 3766 | { | 3767 | { |
| 3767 | XOVERLAY (overlay)->next = b->overlays_after; | 3768 | XOVERLAY (overlay)->next = b->overlays_after; |
| 3768 | b->overlays_after = XOVERLAY (overlay); | 3769 | b->overlays_after = XOVERLAY (overlay); |