diff options
| author | Miles Bader | 2000-08-08 23:45:38 +0000 |
|---|---|---|
| committer | Miles Bader | 2000-08-08 23:45:38 +0000 |
| commit | ac869cf7156a3da3b015ca070c202b493082ce44 (patch) | |
| tree | edb96f3c54979b9d9341243d9e82b7b36b9fba66 /src/buffer.c | |
| parent | 5ed65b55a53119a6c221a0620a47e031b16cc7e4 (diff) | |
| download | emacs-ac869cf7156a3da3b015ca070c202b493082ce44.tar.gz emacs-ac869cf7156a3da3b015ca070c202b493082ce44.zip | |
(overlays_at): Add CHANGE_REQ parameter.
(Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change): Use it.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c index 120392cebba..17bf353afac 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Buffer manipulation primitives for GNU Emacs. | 1 | /* Buffer manipulation primitives for GNU Emacs. |
| 2 | Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999 | 2 | Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -2230,16 +2230,21 @@ swap_out_buffer_local_variables (b) | |||
| 2230 | If EXTEND is non-zero, we make the vector bigger if necessary. | 2230 | If EXTEND is non-zero, we make the vector bigger if necessary. |
| 2231 | If EXTEND is zero, we never extend the vector, | 2231 | If EXTEND is zero, we never extend the vector, |
| 2232 | and we store only as many overlays as will fit. | 2232 | and we store only as many overlays as will fit. |
| 2233 | But we still return the total number of overlays. */ | 2233 | But we still return the total number of overlays. |
| 2234 | |||
| 2235 | If CHANGE_REQ is true, then any position written into *PREV_PTR or | ||
| 2236 | *NEXT_PTR is guaranteed to be not equal to POS, unless it is the | ||
| 2237 | default (BEGV or ZV). */ | ||
| 2234 | 2238 | ||
| 2235 | int | 2239 | int |
| 2236 | overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) | 2240 | overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr, change_req) |
| 2237 | int pos; | 2241 | int pos; |
| 2238 | int extend; | 2242 | int extend; |
| 2239 | Lisp_Object **vec_ptr; | 2243 | Lisp_Object **vec_ptr; |
| 2240 | int *len_ptr; | 2244 | int *len_ptr; |
| 2241 | int *next_ptr; | 2245 | int *next_ptr; |
| 2242 | int *prev_ptr; | 2246 | int *prev_ptr; |
| 2247 | int change_req; | ||
| 2243 | { | 2248 | { |
| 2244 | Lisp_Object tail, overlay, start, end; | 2249 | Lisp_Object tail, overlay, start, end; |
| 2245 | int idx = 0; | 2250 | int idx = 0; |
| @@ -2345,7 +2350,7 @@ overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) | |||
| 2345 | } | 2350 | } |
| 2346 | else if (endpos < pos && endpos > prev) | 2351 | else if (endpos < pos && endpos > prev) |
| 2347 | prev = endpos; | 2352 | prev = endpos; |
| 2348 | else if (endpos == pos && startpos > prev) | 2353 | else if (endpos == pos && startpos > prev && !change_req) |
| 2349 | prev = startpos; | 2354 | prev = startpos; |
| 2350 | } | 2355 | } |
| 2351 | 2356 | ||
| @@ -3517,7 +3522,7 @@ DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0, | |||
| 3517 | /* Put all the overlays we want in a vector in overlay_vec. | 3522 | /* Put all the overlays we want in a vector in overlay_vec. |
| 3518 | Store the length in len. */ | 3523 | Store the length in len. */ |
| 3519 | noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, | 3524 | noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, |
| 3520 | (int *) 0, (int *) 0); | 3525 | (int *) 0, (int *) 0, 0); |
| 3521 | 3526 | ||
| 3522 | /* Make a list of them all. */ | 3527 | /* Make a list of them all. */ |
| 3523 | result = Flist (noverlays, overlay_vec); | 3528 | result = Flist (noverlays, overlay_vec); |
| @@ -3580,7 +3585,7 @@ If there are no more overlay boundaries after POS, return (point-max).") | |||
| 3580 | Store the length in len. | 3585 | Store the length in len. |
| 3581 | endpos gets the position where the next overlay starts. */ | 3586 | endpos gets the position where the next overlay starts. */ |
| 3582 | noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, | 3587 | noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, |
| 3583 | &endpos, (int *) 0); | 3588 | &endpos, (int *) 0, 1); |
| 3584 | 3589 | ||
| 3585 | /* If any of these overlays ends before endpos, | 3590 | /* If any of these overlays ends before endpos, |
| 3586 | use its ending point instead. */ | 3591 | use its ending point instead. */ |
| @@ -3625,7 +3630,7 @@ If there are no more overlay boundaries before POS, return (point-min).") | |||
| 3625 | Store the length in len. | 3630 | Store the length in len. |
| 3626 | prevpos gets the position of the previous change. */ | 3631 | prevpos gets the position of the previous change. */ |
| 3627 | noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, | 3632 | noverlays = overlays_at (XINT (pos), 1, &overlay_vec, &len, |
| 3628 | (int *) 0, &prevpos); | 3633 | (int *) 0, &prevpos, 1); |
| 3629 | 3634 | ||
| 3630 | xfree (overlay_vec); | 3635 | xfree (overlay_vec); |
| 3631 | return make_number (prevpos); | 3636 | return make_number (prevpos); |