2074 |
{ |
{ |
2075 |
int it_start; |
int it_start; |
2076 |
int oselective; |
int oselective; |
2077 |
int start_on_image_p; |
int start_on_image_or_stretch_p; |
2078 |
|
|
2079 |
SET_TEXT_POS (pt, PT, PT_BYTE); |
SET_TEXT_POS (pt, PT, PT_BYTE); |
2080 |
start_display (&it, w, pt); |
start_display (&it, w, pt); |
2086 |
while the end position is really at some X > 0, the same X that |
while the end position is really at some X > 0, the same X that |
2087 |
PT had. */ |
PT had. */ |
2088 |
it_start = IT_CHARPOS (it); |
it_start = IT_CHARPOS (it); |
2089 |
start_on_image_p = (it.method == GET_FROM_IMAGE); |
start_on_image_or_stretch_p = (it.method == GET_FROM_IMAGE |
2090 |
|
|| it.method == GET_FROM_STRETCH); |
2091 |
reseat_at_previous_visible_line_start (&it); |
reseat_at_previous_visible_line_start (&it); |
2092 |
it.current_x = it.hpos = 0; |
it.current_x = it.hpos = 0; |
2093 |
/* Temporarily disable selective display so we don't move too far */ |
/* Temporarily disable selective display so we don't move too far */ |
2098 |
|
|
2099 |
/* Move back if we got too far. This may happen if |
/* Move back if we got too far. This may happen if |
2100 |
truncate-lines is on and PT is beyond right margin. |
truncate-lines is on and PT is beyond right margin. |
2101 |
It may also happen if it_start is on an image -- |
It may also happen if it_start is on an image or a stretch |
2102 |
in that case, don't go back. */ |
glyph -- in that case, don't go back. */ |
2103 |
if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 && !start_on_image_p) |
if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 |
2104 |
|
&& !start_on_image_or_stretch_p) |
2105 |
move_it_by_lines (&it, -1, 0); |
move_it_by_lines (&it, -1, 0); |
2106 |
|
|
2107 |
it.vpos = 0; |
it.vpos = 0; |