From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27525: 25.1; Line wrapping of bidi paragraphs Date: Thu, 29 Jun 2017 17:55:43 +0300 Message-ID: <83h8yyrggg.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1498748253 5251 195.159.176.226 (29 Jun 2017 14:57:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Jun 2017 14:57:33 +0000 (UTC) Cc: 27525@debbugs.gnu.org To: Itai Berli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 29 16:57:29 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQasX-0000Ev-Ln for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 16:57:09 +0200 Original-Received: from localhost ([::1]:39809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQasd-00061D-2h for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 10:57:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQasW-00060u-4t for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 10:57:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQasQ-0003fK-Gq for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 10:57:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42119) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQasQ-0003fE-DR for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 10:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dQasQ-0006tO-3G for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 10:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Jun 2017 14:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27525 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27525-submit@debbugs.gnu.org id=B27525.149874817026438 (code B ref 27525); Thu, 29 Jun 2017 14:57:02 +0000 Original-Received: (at 27525) by debbugs.gnu.org; 29 Jun 2017 14:56:10 +0000 Original-Received: from localhost ([127.0.0.1]:44796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQarZ-0006sL-MZ for submit@debbugs.gnu.org; Thu, 29 Jun 2017 10:56:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQarY-0006s8-3q for 27525@debbugs.gnu.org; Thu, 29 Jun 2017 10:56:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQarP-00031a-HV for 27525@debbugs.gnu.org; Thu, 29 Jun 2017 10:56:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQarP-00031K-AH; Thu, 29 Jun 2017 10:55:59 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2917 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dQarO-0006Pr-Hc; Thu, 29 Jun 2017 10:55:59 -0400 In-reply-to: (message from Itai Berli on Thu, 29 Jun 2017 10:23:15 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134029 Archived-At: > From: Itai Berli > 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.