Mercurial > emacs
comparison src/buffer.c @ 25184:290fceb2b1c0
(switch_to_buffer_1): New subroutine, taken out from Fswitch_to_buffer.
(no_switch_buffer): New function.
(Fswitch_to_buffer): Call them. Don't get confused
by "same-window" buffers in a dedicated frame.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 06 Aug 1999 11:45:48 +0000 |
parents | 847441efad8d |
children | 14269f6d315b |
comparison
equal
deleted
inserted
replaced
25183:16937a774275 | 25184:290fceb2b1c0 |
---|---|
2005 Return the number found, and store them in a vector in *VEC_PTR. | 2005 Return the number found, and store them in a vector in *VEC_PTR. |
2006 Store in *LEN_PTR the size allocated for the vector. | 2006 Store in *LEN_PTR the size allocated for the vector. |
2007 Store in *NEXT_PTR the next position after POS where an overlay starts, | 2007 Store in *NEXT_PTR the next position after POS where an overlay starts, |
2008 or ZV if there are no more overlays. | 2008 or ZV if there are no more overlays. |
2009 Store in *PREV_PTR the previous position before POS where an overlay ends, | 2009 Store in *PREV_PTR the previous position before POS where an overlay ends, |
2010 or BEGV if there are no previous overlays. | 2010 or where an overlay starts which ends at or after POS; |
2011 or BEGV if there are no such overlays. | |
2011 NEXT_PTR and/or PREV_PTR may be 0, meaning don't store that info. | 2012 NEXT_PTR and/or PREV_PTR may be 0, meaning don't store that info. |
2012 | 2013 |
2013 *VEC_PTR and *LEN_PTR should contain a valid vector and size | 2014 *VEC_PTR and *LEN_PTR should contain a valid vector and size |
2014 when this function is called. | 2015 when this function is called. |
2015 | 2016 |
2050 { | 2051 { |
2051 if (prev < endpos) | 2052 if (prev < endpos) |
2052 prev = endpos; | 2053 prev = endpos; |
2053 break; | 2054 break; |
2054 } | 2055 } |
2056 startpos = OVERLAY_POSITION (start); | |
2057 /* This one ends at or after POS | |
2058 so its start counts for NEXT_PTR if it's before POS. */ | |
2059 if (prev < startpos && startpos < pos) | |
2060 prev = startpos; | |
2055 if (endpos == pos) | 2061 if (endpos == pos) |
2056 continue; | 2062 continue; |
2057 startpos = OVERLAY_POSITION (start); | |
2058 if (startpos <= pos) | 2063 if (startpos <= pos) |
2059 { | 2064 { |
2060 if (idx == len) | 2065 if (idx == len) |
2061 { | 2066 { |
2062 /* The supplied vector is full. | 2067 /* The supplied vector is full. |
2119 } | 2124 } |
2120 | 2125 |
2121 if (!inhibit_storing) | 2126 if (!inhibit_storing) |
2122 vec[idx] = overlay; | 2127 vec[idx] = overlay; |
2123 idx++; | 2128 idx++; |
2129 | |
2130 if (startpos < pos && startpos > prev) | |
2131 prev = startpos; | |
2124 } | 2132 } |
2125 else if (endpos < pos && endpos > prev) | 2133 else if (endpos < pos && endpos > prev) |
2126 prev = endpos; | 2134 prev = endpos; |
2135 else if (endpos == pos && startpos > prev) | |
2136 prev = startpos; | |
2127 } | 2137 } |
2128 | 2138 |
2129 if (next_ptr) | 2139 if (next_ptr) |
2130 *next_ptr = next; | 2140 *next_ptr = next; |
2131 if (prev_ptr) | 2141 if (prev_ptr) |