emacs-bidi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-bidi] Does this sample file look right?


From: Eli Zaretskii
Subject: Re: [emacs-bidi] Does this sample file look right?
Date: Wed, 19 May 2010 18:53:01 +0300

> From: Scot Becker <address@hidden>
> Date: Wed, 19 May 2010 11:18:37 +0100
> 
> What I see:  The Hebrew paragraphs are happily RTL, and vowels look
> good, depending on the font.  But the paragraphs are also
> left-aligned.  This means that the short ones start half way through
> the screen line (rather than at the right edge), and the longer ones
> wrap UPwards if the window is narrow.  E.g. two-line paragrahs start
> on the second line, and proceed leftwards till the logical end of the
> screen line, then continue on the right edge of the preceding line.
> This happens also with visual line mode on.
> 
> Is the left-alignment a feature of this particular file, or of the
> Emacs bidi display algorigthm?

It's a bit of both, actually.  It's a combination of the following
factors:

 . bidi-paragraph-direction is nil, so Emacs determines the direction
   of each paragraph by its first strong directional character.  This
   is what the Unicode Bidirectional Algorithm mandates, and the Emacs
   implementation follows that.

 . "paragraph" for this purpose is defined in Emacs-y way: it must
   follow an empty line or a form-feed (^L) character.  This is a
   deviation from Unicode (which says that every newline begins a
   paragraph), but the Bidirectional Algorithm allows such deviations
   if some "higher-level protocols" impose it.  Obviously, having each
   line start in a different direction would be a nuisance, so I did
   take the "higher-level protocol" fire escape.

 . This file has English text at the beginning of each paragraph, so
   Emacs renders the text as left-to-right paragraphs.

You can have what you want in several different ways:

 . Set bidi-paragraph-direction to right-to-left.  This will force all
   paragraphs in the buffer to begin at the right margin of the
   window.

 . Insert an RLM character before "GENESIS".  This character is
   invisible, but it is a strong R2L character, so it will cause the
   paragraph direction to change.

 . Insert a single newline before each Hebrew line.  This will make
   each such line a separate paragraph, whose direction will be
   determined as right-to-left.

The first of these 3 methods does not change the text, so I think it's
preferable in this case.

> The file is the product of an OpenOffice export of a original .doc
> file

How did OpenOffice display it?

> I tried to set bidi-paragraph-direction without success.

??? It does work for me to set bidi-paragraph-direction.  What did you
try, and how did it fail?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]