From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bidi,gmane.emacs.devel Subject: Re: Now: Paragraph Direction Detection and Harmonization -- Was: Re: Bidirectional editing in Emacs -- main design decisions Date: Tue, 26 Apr 2011 01:00:52 +0300 Message-ID: <83vcy27zzf.fsf@gnu.org> References: <83bpkgl113.fsf@gnu.org> <8362qbsj7p.fsf@gnu.org> <83y636grgj.fsf@gnu.org> <838vuy9prx.fsf@gnu.org> <834o5m9mxs.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1303768865 1547 80.91.229.12 (25 Apr 2011 22:01:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Apr 2011 22:01:05 +0000 (UTC) Cc: emacs-bidi@gnu.org, emacs-devel@gnu.org To: Mohsen BANAN Original-X-From: emacs-bidi-bounces+gnu-emacs-bidi=m.gmane.org@gnu.org Tue Apr 26 00:01:01 2011 Return-path: Envelope-to: gnu-emacs-bidi@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QETq0-00041A-UT for gnu-emacs-bidi@m.gmane.org; Tue, 26 Apr 2011 00:01:01 +0200 Original-Received: from localhost ([::1]:48515 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QETq0-0004zB-J5 for gnu-emacs-bidi@m.gmane.org; Mon, 25 Apr 2011 18:01:00 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QETpy-0004yu-1o for emacs-bidi@gnu.org; Mon, 25 Apr 2011 18:00:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QETpw-0003Q2-GA for emacs-bidi@gnu.org; Mon, 25 Apr 2011 18:00:58 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:44253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QETpw-0003Pw-8c; Mon, 25 Apr 2011 18:00:56 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LK800900ADV2900@a-mtaout21.012.net.il>; Tue, 26 Apr 2011 01:00:54 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.59.73]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LK80086FAHBPAC0@a-mtaout21.012.net.il>; Tue, 26 Apr 2011 01:00:54 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.169 X-BeenThere: emacs-bidi@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of Emacs support for multi-directional text." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-bidi-bounces+gnu-emacs-bidi=m.gmane.org@gnu.org Original-Sender: emacs-bidi-bounces+gnu-emacs-bidi=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bidi:874 gmane.emacs.devel:138768 Archived-At: > From: Mohsen BANAN > Cc: Mohsen BANAN , emacs-bidi@gnu.org, emacs-devel@gnu.org > Date: Mon, 25 Apr 2011 14:31:22 -0700 > > I am saying that emacs display is correct but that > there are interoperability problems. That could be, but it sounds like the solution to those problems should be on the Firefox side. Or maybe Firefox also has some customization feature, like bidi-paragraph-direction in Emacs. > For example, I think that it is worthwhile for > emacs24 to have a good Conformance Statement for > http://unicode.org/reports/tr9/ We already do, see etc/NEWS: Reordering of bidirectional text for display in Emacs is a "Full bidirectionality" class implementation of the Unicode Bidirectional Algorithm. Is that what you meant by "conformance statement"? If not, what is it? > The existence of -- Unicode Standard Annex #9 -- > Unicode Bidirectional Algorithm -- speaks to that > requirement for harmonization. If every application out there implements UAX#9 to the letter, there shouldn't be interoperability problems. > I looked in there for information about > dynamic paragraph direction detection and did not > find much. It is in section 3.3.1 there: P2. In each paragraph, find the first character of type L, AL, or R. [...] P3. If a character is found in P2 and it is of type AL or R, then set the paragraph embedding level to one; otherwise, set it to zero. Whenever a higher-level protocol specifies the paragraph level, rules P2 and P3 do not apply. Setting the paragraph embedding level to 1 means the paragraph direction is right-to-left; zero means it is left-to-right. The last sentence, about "higher-level protocols", is important, because Emacs does employ such protocols. > I think that the dynamic paragraph direction > detection in emacs needs improvement. If you have specific practical suggestions (after reading the description I point to below), please spell them out. > In the email citation the direction was guessed > wrong although that paragraph was dominantly RTL. That is because there was no paragraph separator between the previous parts of text, which was left-to-right, and the Farsi part. Emacs generally keeps the direction of the previous paragraph as long as it doesn't see a new one. > Can you please expand on what algorithm you use to > determine dynamic paragraph direction? I explained that some time ago, see this message: http://lists.gnu.org/archive/html/emacs-devel/2009-10/msg00234.html Look for "Paragraph base direction" there. In addition, the Emacs manual tells something about this in the node "Bidirectional Editing". > With respect to: > > Eli> I don't care about Firefox > > I have a different view. I see > Emacs and Firefox as joint sisters. Well, "don't care" means it's not my job to make Firefox better. A single individual can only do this much. I will be happy enough if bidirectional editing support in Emacs is good enough, even though other applications will need to catch up. > With respect to Mozilla-Emacs display > inconsistency for bidi email generated with emacs, > I think the solution is to generate html and > specify paragraph direction explicitly in html. There's no need for that in Emacs, see the message in the URL above. I explained there how you can control the base paragraph direction in plain text, on the user level, by inserting special control characters. > Beyond the basic bidi capability in emacs, there > are several layers above it that we now need to > cultivate. Yes. Volunteers are welcome to contribute code to that effect.