*** buffer.c.~1.551.~ Mon Feb 11 18:56:14 2008 --- buffer.c Fri Mar 14 19:23:10 2008 *************** *** 1634,1640 **** Vbuffer_alist = link; /* Effectively do a delq on buried_buffer_list. */ ! prev = Qnil; for (link = XFRAME (frame)->buried_buffer_list; CONSP (link); link = XCDR (link)) --- 1634,1640 ---- Vbuffer_alist = link; /* Effectively do a delq on buried_buffer_list. */ ! prev = Qnil; for (link = XFRAME (frame)->buried_buffer_list; CONSP (link); link = XCDR (link)) *************** *** 2715,2722 **** return idx; } ! /* Find all the overlays in the current buffer that overlap the range BEG-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. --- 2715,2723 ---- return idx; } ! /* Find all the overlays in the current buffer that overlap the range ! BEG-END, or are empty at BEG, or are empty at END and the buffer is ! widened. Return the number found, and store them in a vector in *VEC_PTR. Store in *LEN_PTR the size allocated for the vector. *************** *** 2751,2756 **** --- 2752,2758 ---- int next = ZV; int prev = BEGV; int inhibit_storing = 0; + int widened = ! NARROWED; for (tail = current_buffer->overlays_before; tail; tail = tail->next) { *************** *** 2768,2777 **** break; } startpos = OVERLAY_POSITION (ostart); ! /* 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 == endpos)) { if (idx == len) { --- 2770,2781 ---- break; } startpos = OVERLAY_POSITION (ostart); ! /* Count an interval if it overlaps the range, is empty at the ! start of the range, or the buffer is widened and the overlay is ! empty at the end of the range. */ if ((beg < endpos && startpos < end) ! || (startpos == endpos ! && (beg == endpos || (widened && endpos == end)))) { if (idx == len) { *************** *** 2816,2825 **** 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 == endpos)) { if (idx == len) { --- 2820,2831 ---- break; } endpos = OVERLAY_POSITION (oend); ! /* Count an interval if it overlaps the range, is empty at the ! start of the range, or the buffer is widened and the overlay is ! empty at the end of the range. */ if ((beg < endpos && startpos < end) ! || (startpos == endpos ! && (beg == endpos || (widened && endpos == end)))) { if (idx == len) { *************** *** 4015,4022 **** doc: /* Return a list of the overlays that overlap the region BEG ... END. Overlap means that at least one character is contained within the overlay and also contained within the specified region. ! Empty overlays are included in the result if they are located at BEG ! or between BEG and END. */) (beg, end) Lisp_Object beg, end; { --- 4021,4028 ---- doc: /* Return a list of the overlays that overlap the region BEG ... END. Overlap means that at least one character is contained within the overlay and also contained within the specified region. ! Empty overlays are included in the result if they are located at BEG, ! between BEG and END, or at END and the buffer is widened. */) (beg, end) Lisp_Object beg, end; {