diff options
| author | Richard M. Stallman | 1996-09-15 01:57:03 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-09-15 01:57:03 +0000 |
| commit | 876aa27cce95483a7acf79c329cb018cc47ea301 (patch) | |
| tree | dc8363e38d89f569ca171198837b9d2a5749dfc6 /src | |
| parent | cc885e42e330158bbc63699ca0c4f557a2e74fd7 (diff) | |
| download | emacs-876aa27cce95483a7acf79c329cb018cc47ea301.tar.gz emacs-876aa27cce95483a7acf79c329cb018cc47ea301.zip | |
(modify_overlay): Renamed from redisplay_region
moved here from xdisp.c, and made static. Callers changed.
Update OVERLAY_MODIFF instead of MODIFF.
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c index 1d6b121a1fa..def9c1041dc 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2583,7 +2583,54 @@ rear delimiter advance when text is inserted there.") | |||
| 2583 | 2583 | ||
| 2584 | return overlay; | 2584 | return overlay; |
| 2585 | } | 2585 | } |
| 2586 | |||
| 2587 | /* Mark a section of BUF as needing redisplay because of overlays changes. */ | ||
| 2588 | |||
| 2589 | static void | ||
| 2590 | modify_overlay (buf, start, end) | ||
| 2591 | struct buffer *buf; | ||
| 2592 | int start, end; | ||
| 2593 | { | ||
| 2594 | if (start == end) | ||
| 2595 | return; | ||
| 2596 | |||
| 2597 | if (start > end) | ||
| 2598 | { | ||
| 2599 | int temp = start; | ||
| 2600 | start = end; end = temp; | ||
| 2601 | } | ||
| 2602 | |||
| 2603 | /* If this is a buffer not in the selected window, | ||
| 2604 | we must do other windows. */ | ||
| 2605 | if (buf != XBUFFER (XWINDOW (selected_window)->buffer)) | ||
| 2606 | windows_or_buffers_changed = 1; | ||
| 2607 | /* If it's not current, we can't use beg_unchanged, end_unchanged for it. */ | ||
| 2608 | else if (buf != current_buffer) | ||
| 2609 | windows_or_buffers_changed = 1; | ||
| 2610 | /* If multiple windows show this buffer, we must do other windows. */ | ||
| 2611 | else if (buffer_shared > 1) | ||
| 2612 | windows_or_buffers_changed = 1; | ||
| 2613 | else | ||
| 2614 | { | ||
| 2615 | if (unchanged_modified == MODIFF | ||
| 2616 | && overlay_unchanged_modified == OVERLAY_MODIFF) | ||
| 2617 | { | ||
| 2618 | beg_unchanged = start - BEG; | ||
| 2619 | end_unchanged = Z - end; | ||
| 2620 | } | ||
| 2621 | else | ||
| 2622 | { | ||
| 2623 | if (Z - end < end_unchanged) | ||
| 2624 | end_unchanged = Z - end; | ||
| 2625 | if (start - BEG < beg_unchanged) | ||
| 2626 | beg_unchanged = start - BEG; | ||
| 2627 | } | ||
| 2628 | } | ||
| 2629 | |||
| 2630 | ++OVERLAY_MODIFF; | ||
| 2631 | } | ||
| 2586 | 2632 | ||
| 2633 | |||
| 2587 | DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, | 2634 | DEFUN ("move-overlay", Fmove_overlay, Smove_overlay, 3, 4, 0, |
| 2588 | "Set the endpoints of OVERLAY to BEG and END in BUFFER.\n\ | 2635 | "Set the endpoints of OVERLAY to BEG and END in BUFFER.\n\ |
| 2589 | If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.\n\ | 2636 | If BUFFER is omitted, leave OVERLAY in the same buffer it inhabits now.\n\ |
| @@ -2642,11 +2689,11 @@ buffer.") | |||
| 2642 | o_beg = OVERLAY_POSITION (o_beg); | 2689 | o_beg = OVERLAY_POSITION (o_beg); |
| 2643 | o_end = OVERLAY_POSITION (o_end); | 2690 | o_end = OVERLAY_POSITION (o_end); |
| 2644 | 2691 | ||
| 2645 | redisplay_region (ob, XINT (o_beg), XINT (o_end)); | 2692 | modify_overlay (ob, XINT (o_beg), XINT (o_end)); |
| 2646 | } | 2693 | } |
| 2647 | 2694 | ||
| 2648 | /* Redisplay where the overlay is going to be. */ | 2695 | /* Redisplay where the overlay is going to be. */ |
| 2649 | redisplay_region (b, XINT (beg), XINT (end)); | 2696 | modify_overlay (b, XINT (beg), XINT (end)); |
| 2650 | } | 2697 | } |
| 2651 | else | 2698 | else |
| 2652 | /* Redisplay the area the overlay has just left, or just enclosed. */ | 2699 | /* Redisplay the area the overlay has just left, or just enclosed. */ |
| @@ -2661,14 +2708,14 @@ buffer.") | |||
| 2661 | o_end = OVERLAY_POSITION (o_end); | 2708 | o_end = OVERLAY_POSITION (o_end); |
| 2662 | 2709 | ||
| 2663 | if (XINT (o_beg) == XINT (beg)) | 2710 | if (XINT (o_beg) == XINT (beg)) |
| 2664 | redisplay_region (b, XINT (o_end), XINT (end)); | 2711 | modify_overlay (b, XINT (o_end), XINT (end)); |
| 2665 | else if (XINT (o_end) == XINT (end)) | 2712 | else if (XINT (o_end) == XINT (end)) |
| 2666 | redisplay_region (b, XINT (o_beg), XINT (beg)); | 2713 | modify_overlay (b, XINT (o_beg), XINT (beg)); |
| 2667 | else | 2714 | else |
| 2668 | { | 2715 | { |
| 2669 | if (XINT (beg) < XINT (o_beg)) o_beg = beg; | 2716 | if (XINT (beg) < XINT (o_beg)) o_beg = beg; |
| 2670 | if (XINT (end) > XINT (o_end)) o_end = end; | 2717 | if (XINT (end) > XINT (o_end)) o_end = end; |
| 2671 | redisplay_region (b, XINT (o_beg), XINT (o_end)); | 2718 | modify_overlay (b, XINT (o_beg), XINT (o_end)); |
| 2672 | } | 2719 | } |
| 2673 | } | 2720 | } |
| 2674 | 2721 | ||
| @@ -2716,7 +2763,7 @@ DEFUN ("delete-overlay", Fdelete_overlay, Sdelete_overlay, 1, 1, 0, | |||
| 2716 | b->overlays_before = Fdelq (overlay, b->overlays_before); | 2763 | b->overlays_before = Fdelq (overlay, b->overlays_before); |
| 2717 | b->overlays_after = Fdelq (overlay, b->overlays_after); | 2764 | b->overlays_after = Fdelq (overlay, b->overlays_after); |
| 2718 | 2765 | ||
| 2719 | redisplay_region (b, | 2766 | modify_overlay (b, |
| 2720 | marker_position (OVERLAY_START (overlay)), | 2767 | marker_position (OVERLAY_START (overlay)), |
| 2721 | marker_position (OVERLAY_END (overlay))); | 2768 | marker_position (OVERLAY_END (overlay))); |
| 2722 | 2769 | ||
| @@ -3025,7 +3072,7 @@ DEFUN ("overlay-put", Foverlay_put, Soverlay_put, 3, 3, 0, | |||
| 3025 | if (! NILP (buffer)) | 3072 | if (! NILP (buffer)) |
| 3026 | { | 3073 | { |
| 3027 | if (changed) | 3074 | if (changed) |
| 3028 | redisplay_region (XBUFFER (buffer), | 3075 | modify_overlay (XBUFFER (buffer), |
| 3029 | marker_position (OVERLAY_START (overlay)), | 3076 | marker_position (OVERLAY_START (overlay)), |
| 3030 | marker_position (OVERLAY_END (overlay))); | 3077 | marker_position (OVERLAY_END (overlay))); |
| 3031 | if (EQ (prop, Qevaporate) && ! NILP (value) | 3078 | if (EQ (prop, Qevaporate) && ! NILP (value) |