mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-01 01:41:01 -08:00
(append_glyph): Refer to it->char_to_display instead of
it->c. (produce_glyphs): Set the character to print in it->char_to_display. Handle unibyte-display-via-language-environment. (produce_stretch_glyph): Set the character to print in it->char_to_display.
This commit is contained in:
parent
ea37fbb817
commit
d2b4c17d26
2 changed files with 44 additions and 19 deletions
|
|
@ -1,3 +1,13 @@
|
|||
2006-02-07 Kenichi Handa <handa@m17n.org>
|
||||
|
||||
* term.c (append_glyph): Refer to it->char_to_display instead of
|
||||
it->c.
|
||||
(produce_glyphs): Set the character to print in
|
||||
it->char_to_display. Handle
|
||||
unibyte-display-via-language-environment.
|
||||
(produce_stretch_glyph): Set the character to print in
|
||||
it->char_to_display.
|
||||
|
||||
2006-02-06 Kenichi Handa <handa@m17n.org>
|
||||
|
||||
* lread.c (openp): Initialized encoded_fn before GCPRO it.
|
||||
|
|
|
|||
53
src/term.c
53
src/term.c
|
|
@ -1634,10 +1634,10 @@ static void produce_stretch_glyph P_ ((struct it *));
|
|||
|
||||
|
||||
/* Append glyphs to IT's glyph_row. Called from produce_glyphs for
|
||||
terminal frames if IT->glyph_row != NULL. IT->c is the character
|
||||
for which to produce glyphs; IT->face_id contains the character's
|
||||
face. Padding glyphs are appended if IT->c has a IT->pixel_width >
|
||||
1. */
|
||||
terminal frames if IT->glyph_row != NULL. IT->char_to_display is
|
||||
the character for which to produce glyphs; IT->face_id contains the
|
||||
character's face. Padding glyphs are appended if IT->c has a
|
||||
IT->pixel_width > 1. */
|
||||
|
||||
static void
|
||||
append_glyph (it)
|
||||
|
|
@ -1657,7 +1657,7 @@ append_glyph (it)
|
|||
{
|
||||
glyph->type = CHAR_GLYPH;
|
||||
glyph->pixel_width = 1;
|
||||
glyph->u.ch = it->c;
|
||||
glyph->u.ch = it->char_to_display;
|
||||
glyph->face_id = it->face_id;
|
||||
glyph->padding_p = i > 0;
|
||||
glyph->charpos = CHARPOS (it->position);
|
||||
|
|
@ -1708,6 +1708,9 @@ produce_glyphs (it)
|
|||
xassert (it->what == IT_CHARACTER
|
||||
|| it->what == IT_COMPOSITION);
|
||||
|
||||
/* Maybe translate single-byte characters to multibyte. */
|
||||
it->char_to_display = it->c;
|
||||
|
||||
if (it->c >= 040 && it->c < 0177)
|
||||
{
|
||||
it->pixel_width = it->nglyphs = 1;
|
||||
|
|
@ -1737,13 +1740,11 @@ produce_glyphs (it)
|
|||
{
|
||||
int n = nspaces;
|
||||
|
||||
it->c = ' ';
|
||||
it->char_to_display = ' ';
|
||||
it->pixel_width = it->len = 1;
|
||||
|
||||
while (n--)
|
||||
append_glyph (it);
|
||||
|
||||
it->c = '\t';
|
||||
}
|
||||
|
||||
it->pixel_width = nspaces;
|
||||
|
|
@ -1751,14 +1752,30 @@ produce_glyphs (it)
|
|||
}
|
||||
else if (SINGLE_BYTE_CHAR_P (it->c))
|
||||
{
|
||||
/* Coming here means that it->c is from display table, thus we
|
||||
must send the code as is to the terminal. Although there's
|
||||
no way to know how many columns it occupies on a screen, it
|
||||
is a good assumption that a single byte code has 1-column
|
||||
width. */
|
||||
it->pixel_width = it->nglyphs = 1;
|
||||
if (it->glyph_row)
|
||||
append_glyph (it);
|
||||
if (unibyte_display_via_language_environment
|
||||
&& (it->c >= 0240
|
||||
|| !NILP (Vnonascii_translation_table)))
|
||||
{
|
||||
int charset;
|
||||
|
||||
it->char_to_display = unibyte_char_to_multibyte (it->c);
|
||||
charset = CHAR_CHARSET (it->char_to_display);
|
||||
it->pixel_width = CHARSET_WIDTH (charset);
|
||||
it->nglyphs = it->pixel_width;
|
||||
if (it->glyph_row)
|
||||
append_glyph (it);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Coming here means that it->c is from display table, thus we
|
||||
must send the code as is to the terminal. Although there's
|
||||
no way to know how many columns it occupies on a screen, it
|
||||
is a good assumption that a single byte code has 1-column
|
||||
width. */
|
||||
it->pixel_width = it->nglyphs = 1;
|
||||
if (it->glyph_row)
|
||||
append_glyph (it);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1843,17 +1860,15 @@ produce_stretch_glyph (it)
|
|||
Lisp_Object o_object = it->object;
|
||||
Lisp_Object object = it->stack[it->sp - 1].string;
|
||||
int n = width;
|
||||
int c = it->c;
|
||||
|
||||
if (!STRINGP (object))
|
||||
object = it->w->buffer;
|
||||
it->object = object;
|
||||
it->c = ' ';
|
||||
it->char_to_display = ' ';
|
||||
it->pixel_width = it->len = 1;
|
||||
while (n--)
|
||||
append_glyph (it);
|
||||
it->object = o_object;
|
||||
it->c = c;
|
||||
}
|
||||
it->pixel_width = width;
|
||||
it->nglyphs = width;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue