Mercurial > emacs
comparison src/xdisp.c @ 28804:ddc6811eb4c8
(handle_single_display_prop): If display property value
is invalid, or something not supported on the frame, restore
iterator's position to what it was initially. Make sure to return
0 for invalid and unsupported property values.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 03 May 2000 19:48:35 +0000 |
parents | 60ee0a9fb323 |
children | 91b54118e73c |
comparison
equal
deleted
inserted
replaced
28803:80075cf72ede | 28804:ddc6811eb4c8 |
---|---|
2437 struct text_pos start_pos; | 2437 struct text_pos start_pos; |
2438 int valid_p; | 2438 int valid_p; |
2439 | 2439 |
2440 /* Characters having this form of property are not displayed, so | 2440 /* Characters having this form of property are not displayed, so |
2441 we have to find the end of the property. */ | 2441 we have to find the end of the property. */ |
2442 space_or_image_found_p = 1; | |
2443 start_pos = *position; | 2442 start_pos = *position; |
2444 *position = display_prop_end (it, object, start_pos); | 2443 *position = display_prop_end (it, object, start_pos); |
2445 value = Qnil; | 2444 value = Qnil; |
2446 | 2445 |
2447 /* Let's stop at the new position and assume that all | 2446 /* Let's stop at the new position and assume that all |
2487 if ((EQ (location, Qleft_margin) | 2486 if ((EQ (location, Qleft_margin) |
2488 || EQ (location, Qright_margin) | 2487 || EQ (location, Qright_margin) |
2489 || NILP (location)) | 2488 || NILP (location)) |
2490 && valid_p) | 2489 && valid_p) |
2491 { | 2490 { |
2491 space_or_image_found_p = 1; | |
2492 | |
2492 /* Save current settings of IT so that we can restore them | 2493 /* Save current settings of IT so that we can restore them |
2493 when we are finished with the glyph property value. */ | 2494 when we are finished with the glyph property value. */ |
2494 push_it (it); | 2495 push_it (it); |
2495 | 2496 |
2496 if (NILP (location)) | 2497 if (NILP (location)) |
2532 set_iterator_to_next will clean this up. */ | 2533 set_iterator_to_next will clean this up. */ |
2533 *position = start_pos; | 2534 *position = start_pos; |
2534 } | 2535 } |
2535 #endif /* HAVE_WINDOW_SYSTEM */ | 2536 #endif /* HAVE_WINDOW_SYSTEM */ |
2536 } | 2537 } |
2538 else | |
2539 /* Invalid property or property not supported. Restore | |
2540 the position to what it was before. */ | |
2541 *position = start_pos; | |
2537 } | 2542 } |
2538 | 2543 |
2539 return space_or_image_found_p; | 2544 return space_or_image_found_p; |
2540 } | 2545 } |
2541 | 2546 |