On 2 Aug 2015, at 18:15, Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> wrote:

Dear Talal,
Salaam. See below:

On Sun, 02 Aug 2015 07:31:37 -0600, talazem@fastmail.fm <talazem@fastmail.fm> wrote:

Thank you very much for this, Idris. It works nicely in the sample file you sent. But it goes off again once you add \setupdirections[bidi=global]. Consider the following:

==========
<snip>

\setupdirections[bidi=global]

\setupthinrules[color=white]
\setupwhitespace[big]

\section{Incorrect}
\startlinenumbering
\startalignment[r2l]
هذه رسالة لطيفة ألفها العالم الكبير الفهامة النحرير.
هذه رسالة جامعة مانعة ألفها الشيخ الفاضل...
\thinrule
===========

You're right. \thinrule has LR unicode characters which is probably why it gets thrown off. So if you turn off global bidi and then either 1) just go with either global RL or 2) invoke RL inside the linenumbering it will work:

% \setupdirections[bidi=global]
\righttoleft %% global RL

or just

\startlinenumbering
\righttoleft %% local RL, not needed if global RL invoked
\startalignment[r2l]

Again, it's a barbarous (and temporary) workaround. See attached.

Wassalaam
Idris

PS Unless there is a lot of Latin in the critical edition file, I would probably depend more on explicit dir commands (\righttolet, \lefttoright) and less on bidi, which is still buggy in a number of ways. Beyond the ConTeXt implementation: The unicode bidi algorithm was not designed with advanced typesetting and typography in mind, works best for text-editing etc. per se. so local bidi *may perhaps* be more useful than global bidi for the critical-edition portion your project.

I'm not at all suggesting that this particular bug should not be a priority; printing paragraph lines in a linenumbering environment *must* be direction-agnostic. Just a matter of general strategy to consider.
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523<r2l-linenumbering-arabic.tex><r2l-linenumbering-arabic.pdf>___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________