comparison src/xdisp.c @ 108456:07667a45e678

Merge from mainline.
author Katsumi Yamaoka <katsumi@flagship2>
date Mon, 26 Apr 2010 12:48:35 +0000
parents cfcf7c495ca4
children e61225c9e186
comparison
equal deleted inserted replaced
108455:2d8a4d786871 108456:07667a45e678
5257 p->display_ellipsis_p = 0; 5257 p->display_ellipsis_p = 0;
5258 p->line_wrap = it->line_wrap; 5258 p->line_wrap = it->line_wrap;
5259 ++it->sp; 5259 ++it->sp;
5260 } 5260 }
5261 5261
5262 static void
5263 iterate_out_of_display_property (it)
5264 struct it *it;
5265 {
5266 /* Maybe initialize paragraph direction. If we are at the beginning
5267 of a new paragraph, next_element_from_buffer may not have a
5268 chance to do that. */
5269 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
5270 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
5271 /* prev_stop can be zero, so check against BEGV as well. */
5272 while (it->bidi_it.charpos >= BEGV
5273 && it->prev_stop <= it->bidi_it.charpos
5274 && it->bidi_it.charpos < CHARPOS (it->position))
5275 bidi_get_next_char_visually (&it->bidi_it);
5276 /* Record the stop_pos we just crossed, for when we cross it
5277 back, maybe. */
5278 if (it->bidi_it.charpos > CHARPOS (it->position))
5279 it->prev_stop = CHARPOS (it->position);
5280 /* If we ended up not where pop_it put us, resync IT's
5281 positional members with the bidi iterator. */
5282 if (it->bidi_it.charpos != CHARPOS (it->position))
5283 {
5284 SET_TEXT_POS (it->position,
5285 it->bidi_it.charpos, it->bidi_it.bytepos);
5286 it->current.pos = it->position;
5287 }
5288 }
5262 5289
5263 /* Restore IT's settings from IT->stack. Called, for example, when no 5290 /* Restore IT's settings from IT->stack. Called, for example, when no
5264 more overlay strings must be processed, and we return to delivering 5291 more overlay strings must be processed, and we return to delivering
5265 display elements from a buffer, or when the end of a string from a 5292 display elements from a buffer, or when the end of a string from a
5266 `display' property is reached and we return to delivering display 5293 `display' property is reached and we return to delivering display
5307 because the internal coherency of the bidi iterator state 5334 because the internal coherency of the bidi iterator state
5308 can not be preserved across such jumps.) We also must 5335 can not be preserved across such jumps.) We also must
5309 determine the paragraph base direction if the overlay we 5336 determine the paragraph base direction if the overlay we
5310 just processed is at the beginning of a new 5337 just processed is at the beginning of a new
5311 paragraph. */ 5338 paragraph. */
5312 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV) 5339 iterate_out_of_display_property (it);
5313 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
5314 /* prev_stop can be zero, so check against BEGV as well. */
5315 while (it->bidi_it.charpos >= BEGV
5316 && it->prev_stop <= it->bidi_it.charpos
5317 && it->bidi_it.charpos < CHARPOS (it->position))
5318 bidi_get_next_char_visually (&it->bidi_it);
5319 /* Record the stop_pos we just crossed, for when we cross it
5320 back, maybe. */
5321 if (it->bidi_it.charpos > CHARPOS (it->position))
5322 it->prev_stop = CHARPOS (it->position);
5323 /* If we ended up not where pop_it put us, resync IT's
5324 positional members with the bidi iterator. */
5325 if (it->bidi_it.charpos != CHARPOS (it->position))
5326 {
5327 SET_TEXT_POS (it->position,
5328 it->bidi_it.charpos, it->bidi_it.bytepos);
5329 it->current.pos = it->position;
5330 }
5331 } 5340 }
5332 break; 5341 break;
5333 case GET_FROM_STRING: 5342 case GET_FROM_STRING:
5334 it->object = it->string; 5343 it->object = it->string;
5335 break; 5344 break;
17977 abort (); /* row at ZV was already handled above */ 17986 abort (); /* row at ZV was already handled above */
17978 set_iterator_to_next (it, 1); 17987 set_iterator_to_next (it, 1);
17979 row_end = it->current; 17988 row_end = it->current;
17980 /* If the character at max_pos+1 is a newline, skip that as 17989 /* If the character at max_pos+1 is a newline, skip that as
17981 well. Note that this may skip some invisible text. */ 17990 well. Note that this may skip some invisible text. */
17982 if (!get_next_display_element (it)) 17991 if (get_next_display_element (it)
17983 abort (); 17992 && ITERATOR_AT_END_OF_LINE_P (it))
17984 if (ITERATOR_AT_END_OF_LINE_P (it))
17985 { 17993 {
17986 set_iterator_to_next (it, 1); 17994 set_iterator_to_next (it, 1);
17987 /* Record the position after the newline of a continued 17995 /* Record the position after the newline of a continued
17988 row. We will need that to set ROW->end of the last 17996 row. We will need that to set ROW->end of the last
17989 row produced for a continued line. */ 17997 row produced for a continued line. */