[Top][All Lists]

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

bug#27525: 25.1; Line wrapping of bidi paragraphs

From: Eli Zaretskii
Subject: bug#27525: 25.1; Line wrapping of bidi paragraphs
Date: Thu, 29 Jun 2017 17:55:43 +0300

> From: Itai Berli <address@hidden>
> Date: Thu, 29 Jun 2017 10:23:15 +0300
> The line-wrapping algorithm for formatting multi-lingual paragraphs
> containing text in languages of opposite directionality (e.g. English
> and Hebrew) is inconsistent with other text editing applications
> (including Gmail, Google Docs, Libre Writer, MS-Word, Pages, and
> TextEdit), as well as with Emacs itself!

The inconsistency with Emacs is because in the first case the text is
broken into separate lines with newlines, whereas in the second it's a
single long line.

> נאום גטיסבורג Four score and seven years ago our fathers brought forth
> on this continent, a new nation, conceived in Liberty, and dedicated to
> the proposition that all men are created equal.
> When I type this inside the `M-x report-emacs-bug` buffer, and press
> `RET`, the paragraph lines wrap as follows, similar to how the other
> applications mentioned above handle it.
> ILLUSTRATION: A correct way to line-wrap a bidi paragraph
> http://imgur.com/9VDZFz0
> If I now copy this paragraph and paste it in a new buffer, the line
> wrapping is preserved.
> However, when I *type* the same paragraph inside a new buffer, (as well as
> when I finish typing the paragraph insie the `M-x report-emacs-bug`
> buffer, just before pressing `RET`), the lines wrap as follows.
> ILLUSTRATION: An incorrect way to line-wrap a bidi paragraph
> http://imgur.com/Bckn7zP
> Observe that the English text flows from the bottom of the paragraph to
> the top, which makes no sense, since the words of the paragraph have a
> natural, logical ordering within the paragraph that is independent of their
> directionality, but the way the lines are wrapped in the last screenshot
> disrupts this logical order by placing the last word ('equal') on the
> same line as the first two words (the Hebrew words), whereas the third
> word ('Four') is positioned two lines apart.

Yes, Emacs's line-wrapping doesn't work well when the text
directionality is opposite to the paragraph direction.  The reasons
are technical (I can tell the details if someone is interested), but
in the nutshell the requirements of the UBA in that area would need a
thorough change of how the basic Emacs display layout is designed.

The remedy is usually simple: break the long lines into shorter ones
by inserting newlines.

reply via email to

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