diff options
| author | Richard M. Stallman | 1995-07-07 13:31:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-07-07 13:31:48 +0000 |
| commit | 2a3eeee73eaaf864e0fa31dd9f90f8f319c37faf (patch) | |
| tree | 04105a14f60a960afee97d88ab729ad9f3e562ea /src/buffer.c | |
| parent | e0b934886f096e54f8c36799f0466d047c25edbc (diff) | |
| download | emacs-2a3eeee73eaaf864e0fa31dd9f90f8f319c37faf.tar.gz emacs-2a3eeee73eaaf864e0fa31dd9f90f8f319c37faf.zip | |
(overlays_in): Don't count empty overlays at END.
(Foverlays_in): Likewise.
Diffstat (limited to 'src/buffer.c')
| -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) | |||
| 1695 | } | 1695 | } |
| 1696 | 1696 | ||
| 1697 | /* Find all the overlays in the current buffer that overlap the range BEG-END | 1697 | /* Find all the overlays in the current buffer that overlap the range BEG-END |
| 1698 | plus empty overlays anywhere from BEG to END. | 1698 | or are empty at BEG. |
| 1699 | |||
| 1699 | Return the number found, and store them in a vector in *VEC_PTR. | 1700 | Return the number found, and store them in a vector in *VEC_PTR. |
| 1700 | Store in *LEN_PTR the size allocated for the vector. | 1701 | Store in *LEN_PTR the size allocated for the vector. |
| 1701 | Store in *NEXT_PTR the next position after POS where an overlay starts, | 1702 | 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) | |||
| 1748 | } | 1749 | } |
| 1749 | startpos = OVERLAY_POSITION (ostart); | 1750 | startpos = OVERLAY_POSITION (ostart); |
| 1750 | /* Count an interval if it either overlaps the range | 1751 | /* Count an interval if it either overlaps the range |
| 1751 | or is empty at either end of the range. */ | 1752 | or is empty at the start of the range. */ |
| 1752 | if ((beg < endpos && startpos < end) | 1753 | if ((beg < endpos && startpos < end) |
| 1753 | || (startpos == endpos && beg == startpos) | 1754 | || (startpos == endpos && beg == endpos)) |
| 1754 | || (startpos == endpos && end == startpos)) | ||
| 1755 | { | 1755 | { |
| 1756 | if (idx == len) | 1756 | if (idx == len) |
| 1757 | { | 1757 | { |
| @@ -1794,9 +1794,10 @@ overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr) | |||
| 1794 | break; | 1794 | break; |
| 1795 | } | 1795 | } |
| 1796 | endpos = OVERLAY_POSITION (oend); | 1796 | endpos = OVERLAY_POSITION (oend); |
| 1797 | /* Count an interval if it either overlaps the range | ||
| 1798 | or is empty at the start of the range. */ | ||
| 1797 | if ((beg < endpos && startpos < end) | 1799 | if ((beg < endpos && startpos < end) |
| 1798 | || (startpos == endpos && beg == startpos) | 1800 | || (startpos == endpos && beg == endpos)) |
| 1799 | || (startpos == endpos && end == startpos)) | ||
| 1800 | { | 1801 | { |
| 1801 | if (idx == len) | 1802 | if (idx == len) |
| 1802 | { | 1803 | { |
| @@ -2755,9 +2756,11 @@ DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 1, 0, | |||
| 2755 | } | 2756 | } |
| 2756 | 2757 | ||
| 2757 | DEFUN ("overlays-in", Foverlays_in, Soverlays_in, 2, 2, 0, | 2758 | DEFUN ("overlays-in", Foverlays_in, Soverlays_in, 2, 2, 0, |
| 2758 | "Return a list of the overlays that overlap region BEG ... END.\n\ | 2759 | "Return a list of the overlays that overlap the region BEG ... END.\n\ |
| 2759 | This includes empty overlays at BEG or END (as well as empty overlays\n\ | 2760 | Overlap means that at least one character is contained within the overlay\n\ |
| 2760 | within the range.") | 2761 | and also contained within the specified region.\n\ |
| 2762 | Empty overlays are included in the result if they are located at BEG\n\ | ||
| 2763 | or between BEG and END.") | ||
| 2761 | (beg, end) | 2764 | (beg, end) |
| 2762 | Lisp_Object beg, end; | 2765 | Lisp_Object beg, end; |
| 2763 | { | 2766 | { |