From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mohsen BANAN Newsgroups: gmane.emacs.devel,gmane.emacs.bidi Subject: Now: Paragraph Direction Detection and Harmonization -- Was: Re: Bidirectional editing in Emacs -- main design decisions Date: Mon, 25 Apr 2011 14:31:22 -0700 Organization: ByStar Federation of Autonomous Libre Services -- http://www.by-star.net Message-ID: References: <83bpkgl113.fsf@gnu.org> <8362qbsj7p.fsf@gnu.org> <83y636grgj.fsf@gnu.org> <838vuy9prx.fsf@gnu.org> <834o5m9mxs.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1303768906 1713 80.91.229.12 (25 Apr 2011 22:01:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Apr 2011 22:01:46 +0000 (UTC) Cc: emacs-bidi@gnu.org, Mohsen BANAN , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 26 00:01:41 2011 Return-path: Envelope-to: ged-emacs-devel@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 1QETqe-0004M2-W5 for ged-emacs-devel@m.gmane.org; Tue, 26 Apr 2011 00:01:41 +0200 Original-Received: from localhost ([::1]:49198 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QETqe-0005MY-J9 for ged-emacs-devel@m.gmane.org; Mon, 25 Apr 2011 18:01:40 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:34223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QETNQ-0000hY-V2 for emacs-devel@gnu.org; Mon, 25 Apr 2011 17:31:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QETNP-0007po-An for emacs-devel@gnu.org; Mon, 25 Apr 2011 17:31:28 -0400 Original-Received: from 0016.bacs.by-star.net ([198.62.92.166]:48955) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QETNP-0007os-1D for emacs-devel@gnu.org; Mon, 25 Apr 2011 17:31:27 -0400 Original-Received: (qmail 3476 invoked from network); 25 Apr 2011 14:27:17 -0700 Original-Received: from 192.168.0.187 ([192.168.0.187]) by 0016.bacs.by-star.net ([198.62.92.166]) with ESMTP via TCP; 25 Apr 2011 21:27:17 -0000 X-Form-Name: murl-sendlink-toCloseFriends In-Reply-To: <834o5m9mxs.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 25 Apr 2011 21:59:43 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 198.62.92.166 X-Mailman-Approved-At: Mon, 25 Apr 2011 18:01:37 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138770 gmane.emacs.bidi:876 Archived-At: >>>>> On Mon, 25 Apr 2011 21:59:43 +0300, Eli Zaretskii said: >> You see how the Farsi piece (word sequence -- not >> character sequence) is flipped around "Mohsen". Eli> Which one of the two is correct, in the original text or in the Eli> citations? (I don't read Farsi.) Of course, the original is correct. Because I wrote it and I wrote it with emacs. Eli> I think the issue here is paragraph direction, which in Emacs is Eli> dynamically determined by default. See below. I agree. That is the problem.=20=20 I have therefore changed the subject line to: Paragraph Direction Detection and Harmonization Please see below as I expand on what parts I see as non-problem and what parts I think can be improved. >> In the browser my original text appears as it does >> in the citation. Eli> Does the browser display it flushed to the left or to the right? Everything is flushed to the left. Which is consistent your diagnosis of paragraph direction problem. Eli> Does it help to say "M-x set-variable RET bidi-paragraph-direction R= ET Eli> right-to-left RET" in Emacs? Do you see both versions of the text Eli> correctly then? Yes. I have added key bindings for myself for (set-variable 'bidi-paragraph-direction 'right-to-left) and=20 (set-variable 'bidi-paragraph-direction 'left-to-right) for debugging.=20 >> And it displays just fine under emacs24 but word >> sequences are flipped when the browser renders >> that same byte sequence. Eli> So the Emacs display is correct, is that Eli> what you are saying?=20=20 I am saying that emacs display is correct but that there are interoperability problems. Eli> I don't care about Firefox, but I do care Eli> about the bidirectional display in Emacs. The nature of bidi text is such that it demands harmony. For example, I think that it is worthwhile for emacs24 to have a good Conformance Statement for=20 http://unicode.org/reports/tr9/ The existence of -- Unicode Standard Annex #9 -- Unicode Bidirectional Algorithm -- speaks to that requirement for harmonization. I looked in there for information about=20 dynamic paragraph direction detection and did not find much. I think that the dynamic paragraph direction detection in emacs needs improvement. In the email citation the direction was guessed wrong although that paragraph was dominantly RTL. Can you please expand on what algorithm you use to=20 determine dynamic paragraph direction? With respect to: Eli> I don't care about Firefox I have a different view. I see=20 Emacs and Firefox as joint sisters. See Blee: A Deeply Integrated Emacs User Environment For the Software-Servic= e Continuum http://linuxfestnorthwest.org/sessions/blee-deeply-integrated-emacs-user= -environment-software-service-continum for that perspective.=20 A lot of benefits come from integrating the browser with emacs. 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. Beyond the basic bidi capability in emacs, there are several layers above it that we now need to cultivate. Thanks for your help. ...Mohsen ...=D9=85=D8=AD=D8=B3=D9=86