all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Mohsen BANAN <list-general@mohsen.1.banan.byname.net>
Cc: emacs-bidi@gnu.org, emacs-devel@gnu.org
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	[thread overview]
Message-ID: <83vcy27zzf.fsf@gnu.org> (raw)
In-Reply-To: <yx2tydmvx05.fsf_-_@mohsen.1.banan.byname.net>

> From: Mohsen BANAN <list-general@mohsen.1.banan.byname.net>
> Cc: Mohsen BANAN <list-general@mohsen.1.banan.byname.net>,  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.

  reply	other threads:[~2011-04-25 22:00 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-09 21:18 Bidirectional editing in Emacs -- main design decisions Eli Zaretskii
2009-10-09 21:55 ` joakim
2009-10-09 22:29   ` Eli Zaretskii
2009-10-09 22:42     ` joakim
2009-10-10  7:08       ` Eli Zaretskii
2009-10-10  7:28         ` joakim
2009-10-10  8:20           ` Eli Zaretskii
2009-10-09 22:41 ` Eli Zaretskii
2009-10-10  9:16   ` Richard Stallman
2009-10-10 11:38     ` Eli Zaretskii
2009-10-11  8:41       ` Richard Stallman
2009-10-11 20:12         ` Eli Zaretskii
2009-10-11 21:11           ` Eli Zaretskii
2009-10-12 10:11           ` Richard Stallman
2009-10-12 18:40             ` Eli Zaretskii
2009-10-10 13:44 ` Sascha Wilde
2009-10-10 14:06   ` Eli Zaretskii
2009-10-10 15:54     ` Sascha Wilde
2009-10-10 14:57 ` Ehud Karni
2009-10-10 16:38   ` Eli Zaretskii
2009-10-10 15:13 ` Jason Rumney
2009-10-10 16:06   ` Eli Zaretskii
2009-10-10 16:29     ` Jason Rumney
2009-10-10 17:18 ` James Cloos
2009-10-10 18:33   ` Eli Zaretskii
2011-04-18 14:54 ` Eli Zaretskii
2011-04-19 13:11   ` Stefan Monnier
2011-04-19 16:02     ` Eli Zaretskii
2011-04-20  3:15       ` Stefan Monnier
2011-04-25 17:31       ` Mohsen BANAN
2011-04-25 17:58         ` Eli Zaretskii
2011-04-25 18:44           ` Mohsen BANAN
2011-04-25 18:59             ` Eli Zaretskii
2011-04-25 21:31               ` Now: Paragraph Direction Detection and Harmonization -- Was: " Mohsen BANAN
2011-04-25 22:00                 ` Eli Zaretskii [this message]
2011-04-26  7:56                   ` Mohsen BANAN
2011-04-26 18:05                     ` Eli Zaretskii
2011-04-27 21:58                       ` Now: Paragraph Direction Detection and Harmonization Mohsen BANAN
2011-04-26 18:24                   ` Mohsen BANAN
2011-04-26 19:23                     ` Eli Zaretskii
2011-04-26  1:22                 ` Now: Paragraph Direction Detection and Harmonization -- Was: Re: Bidirectional editing in Emacs -- main design decisions Stephen J. Turnbull
2011-04-28  0:52           ` Requesting instructions for enabling bidi by default Mohsen BANAN
2011-04-28  1:21             ` Juanma Barranquero

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

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

  git send-email \
    --in-reply-to=83vcy27zzf.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-bidi@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=list-general@mohsen.1.banan.byname.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.