From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43207: 26.3; Strange bidi behavior Date: Sat, 05 Sep 2020 10:35:52 +0300 Message-ID: <83o8mkptev.fsf@gnu.org> References: <835z8tqpha.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19422"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43207@debbugs.gnu.org To: nisse@lysator.liu.se (Niels =?UTF-8?Q?M=C3=B6ller?=) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 05 09:37:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kESl3-0004xQ-Qv for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Sep 2020 09:37:09 +0200 Original-Received: from localhost ([::1]:52800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kESl2-0003St-Tr for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Sep 2020 03:37:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kESkw-0003SX-Ck for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2020 03:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kESkw-0002Yy-44 for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2020 03:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kESkw-0004Jg-1P for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2020 03:37: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: Sat, 05 Sep 2020 07:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43207 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 43207-submit@debbugs.gnu.org id=B43207.159929137016526 (code B ref 43207); Sat, 05 Sep 2020 07:37:01 +0000 Original-Received: (at 43207) by debbugs.gnu.org; 5 Sep 2020 07:36:10 +0000 Original-Received: from localhost ([127.0.0.1]:41439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kESk6-0004IU-Fx for submit@debbugs.gnu.org; Sat, 05 Sep 2020 03:36:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kESk4-0004IG-6z for 43207@debbugs.gnu.org; Sat, 05 Sep 2020 03:36:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59616) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kESjx-0002WV-KM; Sat, 05 Sep 2020 03:36:01 -0400 Original-Received: from [176.228.60.248] (port=4258 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kESjw-00088x-SZ; Sat, 05 Sep 2020 03:36:01 -0400 In-Reply-To: (nisse@lysator.liu.se) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:187194 Archived-At: > From: nisse@lysator.liu.se (Niels Möller) > Cc: 43207@debbugs.gnu.org > Date: Sat, 05 Sep 2020 08:46:51 +0200 > > Thanks for the explanation. So if the base paragraph direction is > right-to-left, then right arrow is supposed to move logical backwards, > like C-b. Yes. > > You can either insert an empty line between that Arabic line, > > Is there any way to tell emacs that a new paragraph starts, without > inserting anything visible in the buffer? Some special unicode > character, or emacs text property? No, not at the moment. FWIW, I don't think there's a significant need for such a feature, given the related features we already have. > > But this is how most bidi-supporting applications out there behave. > > For what it's worth, display in firefox works differently. The line of > arabic text is right-to-left and right-justified on the screen, but > following lines are left-to-right, more like what I expected. So it > seems to use a different parapgraph heuristics than emacs. Yes, the Unicode Standard allows some leeway in this matter, and Emacs uses it. Firefox is not a text editor, so it doesn't need to cope with the various situations we have every day in Emacs, where text filling rearranges the words at the beginning of a physical line, which generally can change the base direction at random (because the base direction depends on the first string directional character of the first line of the paragraph). Because someone requested strict adherence to the Unicode Bidirectional Algorithm in this particular matter, Emacs does support the "each physical line starts a new paragraph" behavior; you will find in the manual how to set that up using the variables bidi-paragraph-start-re and bidi-paragraph-separate-re. But I don't recommend such a setup in Emacs, for the reasons I described above.