- else
- {
- it->what = IT_IMAGE;
- it->image_id = lookup_image (it->f, value);
- it->position = start_pos;
- it->object = NILP (object) ? it->w->buffer : object;
- it->method = next_element_from_image;
-
- /* Say that we haven't consumed the characters with
- `display' property yet. The call to pop_it in
- set_iterator_to_next will clean this up. */
- *position = start_pos;
- }
-#endif /* HAVE_WINDOW_SYSTEM */
+ || (!FRAME_TERMCAP_P (it->f) && valid_image_p (value))
+#endif /* not HAVE_WINDOW_SYSTEM */
+ || (CONSP (value) && EQ (XCAR (value), Qspace)));
+
+ if (valid_p && !display_replaced_before_p)
+ {
+ /* Save current settings of IT so that we can restore them
+ when we are finished with the glyph property value. */
+ push_it (it);
+
+ if (NILP (location))
+ it->area = TEXT_AREA;
+ else if (EQ (location, Qleft_margin))
+ it->area = LEFT_MARGIN_AREA;
+ else
+ it->area = RIGHT_MARGIN_AREA;
+
+ if (STRINGP (value))
+ {
+ it->string = value;
+ it->multibyte_p = STRING_MULTIBYTE (it->string);
+ it->current.overlay_string_index = -1;
+ IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = 0;
+ it->end_charpos = it->string_nchars = SCHARS (it->string);
+ it->method = next_element_from_string;
+ it->stop_charpos = 0;
+ it->string_from_display_prop_p = 1;
+ /* Say that we haven't consumed the characters with
+ `display' property yet. The call to pop_it in
+ set_iterator_to_next will clean this up. */
+ *position = start_pos;
+ }
+ else if (CONSP (value) && EQ (XCAR (value), Qspace))
+ {
+ it->method = next_element_from_stretch;
+ it->object = value;
+ it->current.pos = it->position = start_pos;