emacs-bidi
[Top][All Lists]
Advanced

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

Re: [emacs-bidi] reordering based on implicit levels


From: Eli Zaretskii
Subject: Re: [emacs-bidi] reordering based on implicit levels
Date: Tue, 13 Nov 2001 09:04:23 +0200

> From: Alex Schroeder <address@hidden>
> Date: Mon, 12 Nov 2001 23:56:20 +0100
> 
> Ok, I fixed my code such that the top-level function does the right
> thing.  I've pasted it here so that you can look at the doc string to
> see wether it makes sense, and I pasted some test cases for you to
> look at.  I think it all works as expected for the obvious cases, now.

There's one aspect of this that bothers me more and more: the fact
that the same function is used for both logical-to-visual and the
reverse conversions.  As much as the code might be similar, the
semantics is different, and the application-level view is also
different.

So I think it's a good idea to make two separate functions for this,
even if they are almost trivial wrappers around the same code, and use
the right function in each case.  If nothing else, it will take an
annoying confusion factor out of our discussions.  (Until now, with
each example you post, I always wonder which conversion is that.)

Here's one important difference between the two conversions.  The
logical to visual conversion needs to decide, one way or the other,
what is the paragraph base direction.  By contrast, for a visual
text, this is almost always known in advance by the calling
application.  So it doesn't make much sense, IMHO, to invoke the
visual-to-logical conversion asking it to guess the direction.  It
also seems wrong to guess the direction by looking at the leftmost
characters, as I think you do: in the visual order, the leftmost
character is not necessarily the first character of the text.  To
know what is the first character of the text, you need to know the
paragraph direction ;-)

At least for now, I suggest that we always discuss conversions from
visual to logical where the paragraph direction is known.



reply via email to

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