static int display_mode_line P_ ((struct window *, enum face_id, Lisp_Object));
static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object, Lisp_Object, int));
static int store_mode_line_string P_ ((char *, Lisp_Object, int, int, int, Lisp_Object));
-static char *decode_mode_spec P_ ((struct window *, int, int, int, int *));
+static char *decode_mode_spec P_ ((struct window *, int, int, int,
+ Lisp_Object *));
static void display_menu_bar P_ ((struct window *));
static int display_count_lines P_ ((int, int, int, int, int *));
static int display_string P_ ((unsigned char *, Lisp_Object, Lisp_Object,
it->dp = XCHAR_TABLE (Vstandard_display_table);
it->stop_charpos = charpos;
+ if (s == NULL && it->multibyte_p)
+ composition_compute_stop_pos (&it->cmp_it, charpos, -1, it->end_charpos,
+ it->string);
CHECK_IT (it);
}
int multibyte;
int bytepos, charpos;
unsigned char *spec;
+ Lisp_Object string;
bytepos = percent_position;
charpos = (STRING_MULTIBYTE (elt)
? string_byte_to_char (elt, bytepos)
: bytepos);
- spec
- = decode_mode_spec (it->w, c, field, prec, &multibyte);
+ spec = decode_mode_spec (it->w, c, field, prec, &string);
+ multibyte = STRINGP (string) && STRING_MULTIBYTE (string);
switch (mode_line_target)
{
int nglyphs_before, nwritten;
nglyphs_before = it->glyph_row->used[TEXT_AREA];
- nwritten = display_string (spec, Qnil, elt,
+ nwritten = display_string (spec, string, elt,
charpos, 0, it,
field, prec, 0,
multibyte);
/* Return a string for the output of a mode line %-spec for window W,
generated by character C. PRECISION >= 0 means don't return a
string longer than that value. FIELD_WIDTH > 0 means pad the
- string returned with spaces to that value. Return 1 in *MULTIBYTE
- if the result is multibyte text.
+ string returned with spaces to that value. Return a Lisp string in
+ *STRING if the resulting string is taken from that Lisp string.
Note we operate on the current buffer for most purposes,
the exception being w->base_line_pos. */
static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------";
static char *
-decode_mode_spec (w, c, field_width, precision, multibyte)
+decode_mode_spec (w, c, field_width, precision, string)
struct window *w;
register int c;
int field_width, precision;
- int *multibyte;
+ Lisp_Object *string;
{
Lisp_Object obj;
struct frame *f = XFRAME (WINDOW_FRAME (w));
struct buffer *b = current_buffer;
obj = Qnil;
- *multibyte = 0;
+ *string = Qnil;
switch (c)
{
if (STRINGP (obj))
{
- *multibyte = STRING_MULTIBYTE (obj);
+ *string = obj;
return (char *) SDATA (obj);
}
else
/* Display a NUL-terminated string, starting with index START.
If STRING is non-null, display that C string. Otherwise, the Lisp
- string LISP_STRING is displayed.
+ string LISP_STRING is displayed. There's a case that STRING is
+ non-null and LISP_STRING is not nil. It means STRING is a string
+ data of LISP_STRING. In that case, we display LISP_STRING while
+ ignoring its text properties.
If FACE_STRING is not nil, FACE_STRING_POS is a position in
FACE_STRING. Display STRING or LISP_STRING with the face at
/* Initialize the iterator IT for iteration over STRING beginning
with index START. */
- reseat_to_string (it, string, lisp_string, start,
+ reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string, start,
precision, field_width, multibyte);
+ if (string && STRINGP (lisp_string))
+ /* LISP_STRING is the one returned by decode_mode_spec. We should
+ ignore its text properties. */
+ it->stop_charpos = -1;
/* If displaying STRING, set up the face of the iterator
from LISP_STRING, if that's given. */
if (j < i)
{
font->driver->draw (s, j, i, x, y, 0);
+ if (s->face->overstrike)
+ font->driver->draw (s, j, i, x + 1, y, 0);
x += width;
}
xoff = LGLYPH_XOFF (glyph);
yoff = LGLYPH_YOFF (glyph);
wadjust = LGLYPH_WADJUST (glyph);
font->driver->draw (s, i, i + 1, x + xoff, y + yoff, 0);
+ if (s->face->overstrike)
+ font->driver->draw (s, i, i + 1, x + xoff + 1, y + yoff, 0);
x += wadjust;
j = i + 1;
width = 0;
}
}
if (j < i)
- font->driver->draw (s, j, i, x, y, 0);
+ {
+ font->driver->draw (s, j, i, x, y, 0);
+ if (s->face->overstrike)
+ font->driver->draw (s, j, i, x + 1, y, 0);
+ }
}
}