[Israel.pm] Displaying bidi text in re (e.g. in the editor).

Mikhael Goikhman migo at homemail.com
Sun Feb 8 01:15:10 PST 2009

On 08 Feb 2009 09:09:59 +0200, Amit Aronovitch wrote:
> On Fri, Feb 6, 2009 at 5:47 AM, Omer Zak wrote:
> > From my experience, when editing mixed directionality text, it is
> > desirable to display the text segment, which one actually edits, in
> > a pure LTR or RTL direction.  Such a text segment would typically
> > be 5-10 characters long in each side of the cursor.
> In normal editing that sounds abit confusing. Interesting suggestion
> though, would be happy to discuss this when we get to dealing with
> cursor movements etc, but prbly elsewhere, as this is getting OT for the
> Perl list.

I don't think it is OT here.

I mostly agree with Omer. But I also agree that having a small window of
10 characters sounds a bit confusing. However having a mode in every
editor to completely disable bidi seems just what a (certain) programmer
wants and is not confusing.

Can such "developer mode" or "character dump mode" meaning pure logical
LTR display be a part of the standard (i.e. a recommendation for every
text editor to implement such mode)?

> > For Latin and Hebrew, pure LTR is OK.  For Hebrew with nikkud and
> > Arabic, pure RTL is necessary.

I am not sure that pure RTL is necessary at all in the pure LTR
environment (like editing programs). As long as all characters are
displayed strictly one after another (without applying visual algorithms
for combining Unicode characters) the pure logical LTR display is not
confusing. I am convinced this "character dump" mode is necessary for
programming or at least a helpful option. Personally I can edit code with
embedded Hebrew text using this mode only.

> > When just presenting text, which is not actually being edited, use the
> > bidi algorithm appropriately.  My personal preference in such a
> > situation would be to suppress the bidi algorithm altogether when
> > editing a Perl or Python script with Hebrew text fragments.
> Is it possible that, at least in part, this is because current
> implementations of bidi display ignore the syntactical context, so would
> cause strange results (e.g. appear to break the syntax) - which are more
> confusing than disabling the whole thing altogether?

Can you please be more specific, why do you think that disabling bidi
altogether may be more confusing, i.e. "cause strange results and appear
to break the syntax", if you can clearly see the logical character order?

I.e. if you clearly see ordered: "HEBREW LETTER BET", "HEBREW POINT
TSERE", "HEBREW LETTER FINAL NUN" (Unicode character names used).

> > I wonder whether Arab speakers can deal with mirror images of Arabic
> > glyphs and use pure LTR display when editing scripts with Arabic text
> > fragments.
> Normally (unless your'e Leo da Vinci of course :-) ), mirror writing is
> considerably slower and harder to read (possibly even harder than
> "reversed order" text), especially when you know the language well
> (young kids might confuse directions). I believe Arabic is no exception
> (even to me it is much slower, and I read Arabic very slowly even in the
> normal direction...).

Please no mirror-graphics display for text editors. :) Unicode contains
many characters already that are mirrored versions of others visually.
Of course this may be an option (if one wants to implement it for his
text editor), just not the default option mentioned in the standard.

I appreciate your effort to develop a single text-editor mode convenient
for both reading and editing of mixed bidi text, but I'd vote for having
two modes, one that is more suitable for viewing and one for editing.
At least as an option.


perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'

More information about the Perl mailing list