unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Itai Berli <itai.berli@gmail.com>
Cc: 27525@debbugs.gnu.org
Subject: bug#27525: 25.1; Line wrapping of bidi paragraphs
Date: Thu, 29 Jun 2017 17:55:43 +0300	[thread overview]
Message-ID: <83h8yyrggg.fsf@gnu.org> (raw)
In-Reply-To: <CABsNJ=P7vXK8j2dXUyfkk-+wUH1JAe=ipwHGnd4Oo=Lx+AZMuQ@mail.gmail.com> (message from Itai Berli on Thu, 29 Jun 2017 10:23:15 +0300)

> From: Itai Berli <itai.berli@gmail.com>
> 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	other threads:[~2017-06-29 14:55 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  7:23 bug#27525: 25.1; Line wrapping of bidi paragraphs Itai Berli
2017-06-29 14:55 ` Eli Zaretskii [this message]
2017-06-29 18:35 ` Itai Berli
2017-07-04  9:10 ` Itai Berli
2017-07-04  9:11   ` Itai Berli
2017-07-04  9:19     ` Itai Berli
2017-07-04 14:43       ` Eli Zaretskii
2017-07-04 14:52         ` Itai Berli
2017-07-04 15:19           ` Eli Zaretskii
2017-07-04 23:05       ` Richard Stallman
2017-07-05  2:29         ` Eli Zaretskii
2017-07-05 22:59           ` Richard Stallman
2017-07-06  2:39             ` Eli Zaretskii
2017-07-06 16:01               ` Richard Stallman
2017-07-06 16:17                 ` Eli Zaretskii
2017-07-07 18:23                   ` Richard Stallman
2017-07-07 19:21                     ` Eli Zaretskii
2017-07-09 18:17           ` Benjamin Riefenstahl
2017-07-09 18:30             ` Eli Zaretskii
2017-07-19  8:50               ` Itai Berli
2017-07-19 12:59                 ` Itai Berli
2017-07-19 17:28                   ` Eli Zaretskii
2017-07-19 21:40                     ` Itai Berli
2017-07-20  5:08                       ` Eli Zaretskii
2017-07-20  7:01                         ` Itai Berli
2017-07-20 11:09                           ` Eli Zaretskii
2017-07-21  6:19                             ` Itai Berli
2017-07-21  8:37                               ` Eli Zaretskii
2017-07-21  9:44                                 ` Itai Berli
2017-07-21 10:58                                   ` Itai Berli
2017-07-21 13:19                                     ` Eli Zaretskii
2017-07-21 13:01                                   ` Eli Zaretskii
2017-07-19 17:24                 ` Eli Zaretskii
2017-07-04 14:40   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h8yyrggg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=27525@debbugs.gnu.org \
    --cc=itai.berli@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).