+\f
+
+/* Push the display property PROP so that it will be rendered at the
+ current position in IT. */
+
+static void
+push_display_prop (struct it *it, Lisp_Object prop)
+{
+ push_it (it);
+
+ /* Never display a cursor on the prefix. */
+ it->avoid_cursor_p = 1;
+
+ if (STRINGP (prop))
+ {
+ if (SCHARS (prop) == 0)
+ {
+ pop_it (it);
+ return;
+ }
+
+ it->string = prop;
+ 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 = GET_FROM_STRING;
+ it->stop_charpos = 0;
+ }
+ else if (CONSP (prop) && EQ (XCAR (prop), Qspace))
+ {
+ it->method = GET_FROM_STRETCH;
+ it->object = prop;
+ }
+#ifdef HAVE_WINDOW_SYSTEM
+ else if (IMAGEP (prop))
+ {
+ it->what = IT_IMAGE;
+ it->image_id = lookup_image (it->f, prop);
+ it->method = GET_FROM_IMAGE;
+ }
+#endif /* HAVE_WINDOW_SYSTEM */
+ else
+ {
+ pop_it (it); /* bogus display property, give up */
+ return;
+ }
+}
+
+/* Return the character-property PROP at the current position in IT. */
+
+static Lisp_Object
+get_it_property (it, prop)
+ struct it *it;
+ Lisp_Object prop;
+{
+ Lisp_Object position;
+
+ if (STRINGP (it->object))
+ position = make_number (IT_STRING_CHARPOS (*it));
+ else if (BUFFERP (it->object))
+ position = make_number (IT_CHARPOS (*it));
+ else
+ return Qnil;
+
+ return Fget_char_property (position, prop, it->object);
+}
+
+/* See if there's a line- or wrap-prefix, and if so, push it on IT. */
+
+static void
+handle_line_prefix (struct it *it)
+{
+ Lisp_Object prefix;
+ if (it->continuation_lines_width > 0)
+ {
+ prefix = get_it_property (it, Qwrap_prefix);
+ if (NILP (prefix))
+ prefix = Vwrap_prefix;
+ }
+ else
+ {
+ prefix = get_it_property (it, Qline_prefix);
+ if (NILP (prefix))
+ prefix = Vline_prefix;
+ }
+ if (! NILP (prefix))
+ push_display_prop (it, prefix);
+}
+
+\f