comparison src/xdisp.c @ 25820:a18595261196

(display_prop_end, invisible_text_between_p): Use next_single_char_property_change.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 26 Sep 1999 10:53:23 +0000
parents 775d0eca0cc3
children 148a6733cd83
comparison
equal deleted inserted replaced
25819:c2163b0bac24 25820:a18595261196
2241 2241
2242 return space_or_image_found_p ? HANDLED_RETURN : HANDLED_NORMALLY; 2242 return space_or_image_found_p ? HANDLED_RETURN : HANDLED_NORMALLY;
2243 } 2243 }
2244 2244
2245 2245
2246 /* Value is the position of the end of the `display' property stating 2246 /* Value is the position of the end of the `display' property starting
2247 at START_POS in OBJECT. */ 2247 at START_POS in OBJECT. */
2248 2248
2249 static struct text_pos 2249 static struct text_pos
2250 display_prop_end (it, object, start_pos) 2250 display_prop_end (it, object, start_pos)
2251 struct it *it; 2251 struct it *it;
2252 Lisp_Object object; 2252 Lisp_Object object;
2253 struct text_pos start_pos; 2253 struct text_pos start_pos;
2254 { 2254 {
2255 Lisp_Object end; 2255 Lisp_Object end;
2256 struct text_pos end_pos; 2256 struct text_pos end_pos;
2257 2257
2258 /* Characters having this form of property are not displayed, so 2258 end = next_single_char_property_change (make_number (CHARPOS (start_pos)),
2259 we have to find the end of the property. */ 2259 Qdisplay, object, Qnil);
2260 end = Fnext_single_property_change (make_number (start_pos.charpos), 2260 CHARPOS (end_pos) = XFASTINT (end);
2261 Qdisplay, object, Qnil); 2261 if (STRINGP (object))
2262 if (NILP (end))
2263 {
2264 /* A nil value of `end' means there are no changes of the
2265 property to the end of the buffer or string. */
2266 if (it->current.overlay_string_index >= 0)
2267 end_pos.charpos = XSTRING (it->string)->size;
2268 else
2269 end_pos.charpos = it->end_charpos;
2270 }
2271 else
2272 end_pos.charpos = XFASTINT (end);
2273
2274 if (STRINGP (it->string))
2275 compute_string_pos (&end_pos, start_pos, it->string); 2262 compute_string_pos (&end_pos, start_pos, it->string);
2276 else 2263 else
2277 end_pos.bytepos = CHAR_TO_BYTE (end_pos.charpos); 2264 BYTEPOS (end_pos) = CHAR_TO_BYTE (XFASTINT (end));
2278 2265
2279 return end_pos; 2266 return end_pos;
2280 } 2267 }
2281 2268
2282 2269
4428 it->window); 4415 it->window);
4429 if (TEXT_PROP_MEANS_INVISIBLE (prop)) 4416 if (TEXT_PROP_MEANS_INVISIBLE (prop))
4430 invisible_found_p = 1; 4417 invisible_found_p = 1;
4431 else 4418 else
4432 { 4419 {
4433 limit = Fnext_single_property_change (make_number (start_charpos), 4420 limit = next_single_char_property_change (make_number (start_charpos),
4434 Qinvisible, 4421 Qinvisible, Qnil,
4435 Fcurrent_buffer (), 4422 make_number (end_charpos));
4436 make_number (end_charpos));
4437 invisible_found_p = XFASTINT (limit) < end_charpos; 4423 invisible_found_p = XFASTINT (limit) < end_charpos;
4438 } 4424 }
4439 4425
4440 return invisible_found_p; 4426 return invisible_found_p;
4441 4427