diff options
| author | Lars Ingebrigtsen | 2021-08-16 15:40:43 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-08-16 15:40:43 +0200 |
| commit | 5d7b1d5fc75752a986ed19d3fd333167ddc29d4e (patch) | |
| tree | 2958f419b095ee6e5f7eada504dfcaf40e5d10a8 /src | |
| parent | a3b31302dd1b7c1ffd3486b35de06c957785b919 (diff) | |
| download | emacs-5d7b1d5fc75752a986ed19d3fd333167ddc29d4e.tar.gz emacs-5d7b1d5fc75752a986ed19d3fd333167ddc29d4e.zip | |
Make overlays-in treat zero-length overlays at point-max consistently
* doc/lispref/display.texi (Finding Overlays): Adjust documentation.
* src/buffer.c (overlays_in): Treat the end of the buffer and the
end of the narrowed-to buffer the same (bug#19422).
(Foverlays_in): Adjust doc string.
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index b177c5eaa7f..7e4c84911bb 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2995,7 +2995,7 @@ overlays_in (EMACS_INT beg, EMACS_INT end, bool extend, | |||
| 2995 | ptrdiff_t next = ZV; | 2995 | ptrdiff_t next = ZV; |
| 2996 | ptrdiff_t prev = BEGV; | 2996 | ptrdiff_t prev = BEGV; |
| 2997 | bool inhibit_storing = 0; | 2997 | bool inhibit_storing = 0; |
| 2998 | bool end_is_Z = end == Z; | 2998 | bool end_is_Z = end == ZV; |
| 2999 | 2999 | ||
| 3000 | for (struct Lisp_Overlay *tail = current_buffer->overlays_before; | 3000 | for (struct Lisp_Overlay *tail = current_buffer->overlays_before; |
| 3001 | tail; tail = tail->next) | 3001 | tail; tail = tail->next) |
| @@ -4268,9 +4268,10 @@ DEFUN ("overlays-in", Foverlays_in, Soverlays_in, 2, 2, 0, | |||
| 4268 | doc: /* Return a list of the overlays that overlap the region BEG ... END. | 4268 | doc: /* Return a list of the overlays that overlap the region BEG ... END. |
| 4269 | Overlap means that at least one character is contained within the overlay | 4269 | Overlap means that at least one character is contained within the overlay |
| 4270 | and also contained within the specified region. | 4270 | and also contained within the specified region. |
| 4271 | |||
| 4271 | Empty overlays are included in the result if they are located at BEG, | 4272 | Empty overlays are included in the result if they are located at BEG, |
| 4272 | between BEG and END, or at END provided END denotes the position at the | 4273 | between BEG and END, or at END provided END denotes the position at the |
| 4273 | end of the buffer. */) | 4274 | end of the accessible part of the buffer. */) |
| 4274 | (Lisp_Object beg, Lisp_Object end) | 4275 | (Lisp_Object beg, Lisp_Object end) |
| 4275 | { | 4276 | { |
| 4276 | ptrdiff_t len, noverlays; | 4277 | ptrdiff_t len, noverlays; |