diff options
| author | Richard M. Stallman <rms@gnu.org> | 1995-07-07 13:31:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1995-07-07 13:31:48 +0000 |
| commit | 2a3eeee73eaaf864e0fa31dd9f90f8f319c37faf (patch) | |
| tree | 04105a14f60a960afee97d88ab729ad9f3e562ea | |
| parent | e0b934886f096e54f8c36799f0466d047c25edbc (diff) | |
| download | emacs-2a3eeee73eaaf864e0fa31dd9f90f8f319c37faf.tar.gz | |
(overlays_in): Don't count empty overlays at END.
(Foverlays_in): Likewise.
| -rw-r--r-- | src/buffer.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/buffer.c b/src/buffer.c index f1334c0b6a0..f4ede7c8e56 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1695,7 +1695,8 @@ overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) } /* Find all the overlays in the current buffer that overlap the range BEG-END - plus empty overlays anywhere from BEG to END. + or are empty at BEG. + Return the number found, and store them in a vector in *VEC_PTR. Store in *LEN_PTR the size allocated for the vector. Store in *NEXT_PTR the next position after POS where an overlay starts, @@ -1748,10 +1749,9 @@ overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) } startpos = OVERLAY_POSITION (ostart); /* Count an interval if it either overlaps the range - or is empty at either end of the range. */ + or is empty at the start of the range. */ if ((beg < endpos && startpos < end) - || (startpos == endpos && beg == startpos) - || (startpos == endpos && end == startpos)) + || (startpos == endpos && beg == endpos)) { if (idx == len) { @@ -1794,9 +1794,10 @@ overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) break; } endpos = OVERLAY_POSITION (oend); + /* Count an interval if it either overlaps the range + or is empty at the start of the range. */ if ((beg < endpos && startpos < end) - || (startpos == endpos && beg == startpos) - || (startpos == endpos && end == startpos)) + || (startpos == endpos && beg == endpos)) { if (idx == len) { @@ -2755,9 +2756,11 @@ DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0, } DEFUN ("overlays-in", Foverlays_in, Soverlays_in, 2, 2, 0, - "Return a list of the overlays that overlap region BEG ... END.\n\ -This includes empty overlays at BEG or END (as well as empty overlays\n\ -within the range.") + "Return a list of the overlays that overlap the region BEG ... END.\n\ +Overlap means that at least one character is contained within the overlay\n\ +and also contained within the specified region.\n\ +Empty overlays are included in the result if they are located at BEG\n\ +or between BEG and END.") (beg, end) Lisp_Object beg, end; { |
