From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Itai Berli Newsgroups: gmane.emacs.bugs Subject: bug#27525: 25.1; Line wrapping of bidi paragraphs Date: Thu, 29 Jun 2017 10:23:15 +0300 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1498722329 11650 195.159.176.226 (29 Jun 2017 07:45:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Jun 2017 07:45:29 +0000 (UTC) To: 27525@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 29 09:45:23 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 1dQU8b-0002NQ-PZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 09:45:17 +0200 Original-Received: from localhost ([::1]:37450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQU8c-0005GH-Co for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 03:45:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQU8Q-0005AR-Ex for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 03:45:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQU8M-0002rh-0m for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 03:45:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40708) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQU8L-0002rS-To for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 03:45:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dQU8L-0007j0-NN for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 03:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Itai Berli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Jun 2017 07:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27525 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.149872229329661 (code B ref -1); Thu, 29 Jun 2017 07:45:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Jun 2017 07:44:53 +0000 Original-Received: from localhost ([127.0.0.1]:43385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQU8C-0007iL-QM for submit@debbugs.gnu.org; Thu, 29 Jun 2017 03:44:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQToD-0007Ee-19 for submit@debbugs.gnu.org; Thu, 29 Jun 2017 03:24:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQTo1-00016n-Iv for submit@debbugs.gnu.org; Thu, 29 Jun 2017 03:24:07 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33923) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dQTo1-00016f-Ex for submit@debbugs.gnu.org; Thu, 29 Jun 2017 03:24:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQTnz-0007Ky-JP for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 03:24:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQTny-00015i-5M for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 03:23:59 -0400 Original-Received: from mail-vk0-x22f.google.com ([2607:f8b0:400c:c05::22f]:33264) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQTnx-000157-W7 for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 03:23:58 -0400 Original-Received: by mail-vk0-x22f.google.com with SMTP id r126so45390459vkg.0 for ; Thu, 29 Jun 2017 00:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=hSg43hYcqJeM8ZS2qFuieWXqrmg4sXJIRHGoyE2Hzy8=; b=b1TtjrDCiTnVaG4dRpTOuGDfgl9ZXOMFJC6vqmXJOuvZSMeSu1wxBgVhWm6pT1rB63 00Vo8qeIYBNGAiIxjnhfbaVb865IGxVCwAo1or34nIIqm8slkXS8LCYH9ZS7lBFys+8K I6ZccppoNp+aidoIHHTxEVY2D5paQSwkI8eK+flfSwJMcacBuwF+kCY3L+lg1fw2AyJ9 VVI4dKFj8GxNW31PPPrrHPT5DAGGecu0Pv/5wk9eufwWhpylpXHM0V08m/2LMmNERKKf czLs7w/2C/YAVLf74J8OVMtfwauKy+NEVQA88ZUOWpqnRMnvoV4g1O+Jj+gZbhZZdpuK BNPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=hSg43hYcqJeM8ZS2qFuieWXqrmg4sXJIRHGoyE2Hzy8=; b=qssQbfXOD0J4nT+LH1J4V27t5fNaEKwn8fcSo4UltE5vnZ66u0cKzKV+XUuEJKcahy 7Q/5fFJOGHPZ4+iJRg/QSmCq+IAATRcbNbzXItixUpylsYmyvFcp/7s9nmHzJJNEK48b 9szjmnDPuxNqedOIK6GZ8bpkuQ/dHXSFd34j7ojYI4JJ1pEl85VDxU5Y3FNY9sdHBzsY fTu0oiIZweobUaPexJnmO/84D4LJ8pFNr2/Hkqd/oHeElye6brsNNy0lK96y3z/6qonp xLbbE6YUcc/KCBW7tGGsFLicEIoRfPT+VULsNP0N0d+PNt83pZa0ZBB1dRI1UCgkw8VN 0INw== X-Gm-Message-State: AKS2vOza7x1plaYSJ7wMkTECcdYD4vAvTNz3RxKyKQZgF6quwK/9osU/ WD4fXuYlqpxkM4pvdbmnWbc3IR8BLDZ7zBA= X-Received: by 10.31.87.198 with SMTP id l189mr6884898vkb.130.1498721035499; Thu, 29 Jun 2017 00:23:55 -0700 (PDT) Original-Received: by 10.176.70.85 with HTTP; Thu, 29 Jun 2017 00:23:15 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Thu, 29 Jun 2017 03:44:52 -0400 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:134016 Archived-At: 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! Consider as an example the following paragraph that starts with two Hebrew words followed by the opening of Lincoln's Gettysburg Address. =D7=A0=D7=90=D7=95=D7=9D =D7=92=D7=98=D7=99=D7=A1=D7=91=D7=95=D7=A8=D7=92 F= our 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. In GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911)) of 2016-09-21 built on builder10-9.porkrind.org Windowing system distributor 'Apple', version 10.3.1504 Configured using: 'configure --with-ns '--enable-locallisppath=3D/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules' Configured features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: ivy-mode: t shell-dirtrack-mode: t projectile-mode: t helm-descbinds-mode: t async-bytecomp-package-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: ad-handle-definition: =E2=80=98ibuffer=E2=80=99 got redefined Turn on helm-projectile key bindings For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: /Users/itaiberli/.emacs.d/elpa/seq-2.20/seq hides /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/seq Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils colir color counsel jka-compr esh-util etags xref project swiper reftex reftex-vars two-column ivy delsel ivy-overlay helm-projectile helm-files rx image-dired tramp tramp-compat tramp-loaddefs trampver shell pcomplete format-spec dired-x dired-aux ffap helm-tags helm-bookmark helm-adaptive helm-info bookmark pp helm-external helm-net browse-url xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source gnus-util mm-util help-fns mail-prsvr password-cache url-vars mailcap helm-buffers helm-grep helm-regexp helm-utils helm-locate helm-help helm-types projectile grep compile comint ansi-color ring ibuf-ext ibuffer thingatpt helm-descbinds helm easy-mmode helm-source cl-seq eieio-compat eieio eieio-core helm-multi-match helm-lib dired helm-config helm-easymenu cl-macs async-bytecomp async advice edmacro kmacro finder-inf tex-site info package epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 312113 14836) (symbols 48 30403 0) (miscs 40 88 163) (strings 32 51779 9508) (string-bytes 1 1669823) (vectors 16 50217) (vector-slots 8 844607 6040) (floats 8 564 139) (intervals 56 243 0) (buffers 976 18))