aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
authorEli Zaretskii2010-04-20 16:08:35 +0300
committerEli Zaretskii2010-04-20 16:08:35 +0300
commit93d68d0c2b085f65a867024fb8e7e28a629a003a (patch)
treea21bf950974796a985a8e176958de602c4b75ee5 /src/term.c
parent43a03da53d3f6bc82813e070e506b0fc367456a4 (diff)
downloademacs-93d68d0c2b085f65a867024fb8e7e28a629a003a.tar.gz
emacs-93d68d0c2b085f65a867024fb8e7e28a629a003a.zip
Fix R2L paragraph display on TTY.
xdisp.c (unproduce_glyphs): New function. (display_line): Use it when produced glyphs are discarded from R2L glyph rows. (append_composite_glyph): In R2L rows, prepend the glyph rather than appending it. term.c (append_composite_glyph): In R2L rows, prepend the glyph rather than append it. Set up the resolved_level and bidi_type attributes of the appended glyph.
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/term.c b/src/term.c
index 31e0ad223db..eda19d21374 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1589,7 +1589,6 @@ append_glyph (it)
1589 } 1589 }
1590} 1590}
1591 1591
1592
1593/* Produce glyphs for the display element described by IT. *IT 1592/* Produce glyphs for the display element described by IT. *IT
1594 specifies what we want to produce a glyph for (character, image, ...), 1593 specifies what we want to produce a glyph for (character, image, ...),
1595 and where in the glyph matrix we currently are (glyph row and hpos). 1594 and where in the glyph matrix we currently are (glyph row and hpos).
@@ -1808,6 +1807,17 @@ append_composite_glyph (it)
1808 glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area]; 1807 glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area];
1809 if (glyph < it->glyph_row->glyphs[1 + it->area]) 1808 if (glyph < it->glyph_row->glyphs[1 + it->area])
1810 { 1809 {
1810 /* If the glyph row is reversed, we need to prepend the glyph
1811 rather than append it. */
1812 if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
1813 {
1814 struct glyph *g;
1815
1816 /* Make room for the new glyph. */
1817 for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
1818 g[1] = *g;
1819 glyph = it->glyph_row->glyphs[it->area];
1820 }
1811 glyph->type = COMPOSITE_GLYPH; 1821 glyph->type = COMPOSITE_GLYPH;
1812 glyph->pixel_width = it->pixel_width; 1822 glyph->pixel_width = it->pixel_width;
1813 glyph->u.cmp.id = it->cmp_it.id; 1823 glyph->u.cmp.id = it->cmp_it.id;
@@ -1828,6 +1838,18 @@ append_composite_glyph (it)
1828 glyph->padding_p = 0; 1838 glyph->padding_p = 0;
1829 glyph->charpos = CHARPOS (it->position); 1839 glyph->charpos = CHARPOS (it->position);
1830 glyph->object = it->object; 1840 glyph->object = it->object;
1841 if (it->bidi_p)
1842 {
1843 glyph->resolved_level = it->bidi_it.resolved_level;
1844 if ((it->bidi_it.type & 7) != it->bidi_it.type)
1845 abort ();
1846 glyph->bidi_type = it->bidi_it.type;
1847 }
1848 else
1849 {
1850 glyph->resolved_level = 0;
1851 glyph->bidi_type = UNKNOWN_BT;
1852 }
1831 1853
1832 ++it->glyph_row->used[it->area]; 1854 ++it->glyph_row->used[it->area];
1833 ++glyph; 1855 ++glyph;