11210 |
return rc; |
return rc; |
11211 |
} |
} |
11212 |
|
|
11213 |
|
void |
11214 |
|
set_vertical_scroll_bar (w) |
11215 |
|
struct window *w; |
11216 |
|
{ |
11217 |
|
int start, end, whole; |
11218 |
|
|
11219 |
|
/* Calculate the start and end positions for the current window. |
11220 |
|
At some point, it would be nice to choose between scrollbars |
11221 |
|
which reflect the whole buffer size, with special markers |
11222 |
|
indicating narrowing, and scrollbars which reflect only the |
11223 |
|
visible region. |
11224 |
|
|
11225 |
|
Note that mini-buffers sometimes aren't displaying any text. */ |
11226 |
|
if (!MINI_WINDOW_P (w) |
11227 |
|
|| (w == XWINDOW (minibuf_window) |
11228 |
|
&& NILP (echo_area_buffer[0]))) |
11229 |
|
{ |
11230 |
|
struct buffer *buf = XBUFFER (w->buffer); |
11231 |
|
whole = BUF_ZV (buf) - BUF_BEGV (buf); |
11232 |
|
start = marker_position (w->start) - BUF_BEGV (buf); |
11233 |
|
/* I don't think this is guaranteed to be right. For the |
11234 |
|
moment, we'll pretend it is. */ |
11235 |
|
end = BUF_Z (buf) - XFASTINT (w->window_end_pos) - BUF_BEGV (buf); |
11236 |
|
|
11237 |
|
if (end < start) |
11238 |
|
end = start; |
11239 |
|
if (whole < (end - start)) |
11240 |
|
whole = end - start; |
11241 |
|
} |
11242 |
|
else |
11243 |
|
start = end = whole = 0; |
11244 |
|
|
11245 |
|
/* Indicate what this scroll bar ought to be displaying now. */ |
11246 |
|
set_vertical_scroll_bar_hook (w, end - start, whole, start); |
11247 |
|
} |
11248 |
|
|
11249 |
/* Redisplay leaf window WINDOW. JUST_THIS_ONE_P non-zero means only |
/* Redisplay leaf window WINDOW. JUST_THIS_ONE_P non-zero means only |
11250 |
selected_window is redisplayed. |
selected_window is redisplayed. |
11934 |
|
|
11935 |
if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) |
if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) |
11936 |
{ |
{ |
11937 |
int start, end, whole; |
/* Set the thumb's position and size. */ |
11938 |
|
set_vertical_scroll_bar (w); |
|
/* Calculate the start and end positions for the current window. |
|
|
At some point, it would be nice to choose between scrollbars |
|
|
which reflect the whole buffer size, with special markers |
|
|
indicating narrowing, and scrollbars which reflect only the |
|
|
visible region. |
|
|
|
|
|
Note that mini-buffers sometimes aren't displaying any text. */ |
|
|
if (!MINI_WINDOW_P (w) |
|
|
|| (w == XWINDOW (minibuf_window) |
|
|
&& NILP (echo_area_buffer[0]))) |
|
|
{ |
|
|
whole = ZV - BEGV; |
|
|
start = marker_position (w->start) - BEGV; |
|
|
/* I don't think this is guaranteed to be right. For the |
|
|
moment, we'll pretend it is. */ |
|
|
end = (Z - XFASTINT (w->window_end_pos)) - BEGV; |
|
|
|
|
|
if (end < start) |
|
|
end = start; |
|
|
if (whole < (end - start)) |
|
|
whole = end - start; |
|
|
} |
|
|
else |
|
|
start = end = whole = 0; |
|
|
|
|
|
/* Indicate what this scroll bar ought to be displaying now. */ |
|
|
set_vertical_scroll_bar_hook (w, end - start, whole, start); |
|
11939 |
|
|
11940 |
/* Note that we actually used the scroll bar attached to this |
/* Note that we actually used the scroll bar attached to this |
11941 |
window, so it shouldn't be deleted at the end of redisplay. */ |
window, so it shouldn't be deleted at the end of redisplay. */ |