emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Line wrap reconsidered


From: Eli Zaretskii
Subject: Re: Line wrap reconsidered
Date: Sun, 31 May 2020 21:47:38 +0300

> From: Yuan Fu <casouri@gmail.com>
> Date: Sun, 31 May 2020 14:23:38 -0400
> Cc: Lars Ingebrigtsen <larsi@gnus.org>,
>  emacs-devel@gnu.org
> 
> > No, it's in xdisp.c, the code that you are changing.  bidi.c just
> > makes it so that the "next" character is the next one in the visual
> > order, i.e. it replaces a simple increment of buffer position.
> 
> Thanks for your patience. Then how does xdisp.c (or bidi.c) know how much 
> space to leave at the left edge, when the paragraph is right-to-left? For 
> example, in the figure below, how does Emacs determine how much space to 
> leave at the place where I marked with yellow highlighter? I assume the 
> iterater starts from the left edge of the first line and bidi gives it a line 
> with a white space stretch ? The comment says “On graphics terminals, there's 
> a single stretch glyph of a suitably computed width.” Or does the iterator go 
> from right to left?

The iterator thinks the characters are displayed from left to right,
so it does its calculations as usual.  The order reversal happens
because each new glyph is prepended to the previous glyphs, not
appended as in the LTR case (but the iterator doesn't know that).  So
the white space you see at the left side is actually computed and
added at the end, when all the other characters are already in the
glyph row and their width is known.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]