Am 08.06.2007 um 16:16 schrieb Dov Feldstern:

Stefan Schimanski wrote:
Ok, EPM is another issue, maybe even a matter of taste one could enable/disable in the preferences. But first we should get this into svn. José? Dov's patch has my OK.

Great. Next (but the patch shouldn't wait for this!), we have to look into lyx2lyx for converting old files. I have no idea how lyx2lyx works, if anyone can give me pointers that would help. Like, do I have access to a buffer, similarly to the way it works when I'm working in the real document from with the LyX code? What we're going to have to do is find all occurrences of <RTL text><space, regardless of the language><LTR text> and vice versa, and make sure that the space's language is the same direction as that of the paragraph. How would I go about this?

lyx2lyx has some filters for different things in a .lyx code to switch between different versions of the format. Basically you get the .lyx text line by line. There are several function to help to find something, like token parsing for tex, but of course also regexps function which come from python anyway. It looks more or less like that (the _ are spaces in the file. I only put them here to make them visible):

\begin_layout Standard
abc_
\lang hebrew
FED
\lang english
_ghi
\end_layout

So what we have to do is to move those spaces around. If we get this:

\begin_layout Standard
abc
\lang hebrew
_FED
\lang english
_ghi
\end_layout

from LyX 1.3, it in fact means:

\begin_layout Standard
abc_
\lang hebrew
FED
\lang english
_ghi
\end_layout

So for 1.3 -> 1.5 we have to move the space just after a language change into the previous section. For 1.5 -> 1.3 we also move the spaces outside, but the one a the start of the line to the _next_ section, and the one at the end to the previous one.

For 1.4 I don't know.

I looked already into this. I guess it's trivial to implement for somebody who knows python and lyx2lyx. I don't know either very much, so it would help a lot of somebody could help us here. Maybe a posting in its own thread to ask for help would be good.

Stefan

Attachment: PGP.sig
Description: Signierter Teil der Nachricht

Reply via email to