Re: [patch] fix bug 27

2007-12-05 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: >> How can otherlanguage be supported? The default LyX setting is >> \selectlanguage. So when a user mports a LaTeX-file using otherlanguage, he >> gets by default \selectlanguage instead. To make it correct, I would import >> this as ERT. Because hav

Re: [patch] fix bug 27

2007-12-04 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: You are right. Try this one instead. I would really prefer this to what you have now (I find it cleaner). I comitted your version. Note that language is not taken in account as a parameter to \usepackage{babel}; we have actually to look in what order languages a

Re: [patch] fix bug 27

2007-12-04 Thread Jürgen Spitzmüller
Uwe Stöhr wrote: > But as you agree to my patch in general, I'll put in a cleaned up version > according to JMarc's requests. Fine. > How can otherlanguage be supported? The default LyX setting is > \selectlanguage. So when a user mports a LaTeX-file using otherlanguage, he > gets by default \sel

Re: [patch] fix bug 27

2007-12-04 Thread Uwe Stöhr
>> Having another comand then \selectlanguage set in the preferences means >> you're using LyX with arabtex > Not necessarily. You can also use, for instance, babel's > > \begin{otherlanguage} > ... > \end{otherlanguage} My statement was indeed a bit polemic. But anyway, there is not much we can

Re: [patch] fix bug 27

2007-12-04 Thread Jean-Marc Lasgouttes
Uwe Stöhr <[EMAIL PROTECTED]> writes: >> What about the attached (untested) patch instead to remove spaces at >> the source? > > This doesn't work. You are right. Try this one instead. I would really prefer this to what you have now (I find it cleaner). Note that language is not taken in account

Re: [patch] fix bug 27

2007-12-04 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > I think rc.language_command_begin is irrelevant. Granted. I just wanted to point out that the statement "Having another command then \selectlanguage set in the preferences means you're using LyX with arabtex" is not true. I have used other babel commands in the past

Re: [patch] fix bug 27

2007-12-04 Thread Jean-Marc Lasgouttes
Uwe Stöhr <[EMAIL PROTECTED]> writes: >> Also is the explicit 0 needed? > > This needed to specify where to start the search. How would you do this? 0 is the default for this second argument. Just omit it. JMarc

Re: [patch] fix bug 27

2007-12-04 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > As far as I know, rc.language_command_begin is used, and this is > configurable. > So if your LaTeX file contains \selectlanguage, and the user has defined > \begin{otherlanguage*} and \end{otherlanguage*}, those are used instead. Yes, but if a

Re: [patch] fix bug 27

2007-12-03 Thread Jürgen Spitzmüller
Uwe Stöhr wrote: > I haven't: When the LaTex file contains \selectlanguage it _is_ used in > this file as language change command. As far as I know, rc.language_command_begin is used, and this is configurable. So if your LaTeX file contains \selectlanguage, and the user has defined \begin{otherl

Re: [patch] fix bug 27

2007-12-03 Thread Uwe Stöhr
Uwe Stöhr schrieb: Attached is the patch revised according to your annotations. Take this version instead. regards Uwe Index: preamble.cpp === --- preamble.cpp (revision 21941) +++ preamble.cpp (working copy) @@ -3,7 +3,8 @@ *

Re: [patch] fix bug 27

2007-12-03 Thread Uwe Stöhr
> What about the attached (untested) patch instead to remove spaces at > the source? This doesn't work. > + if (it >= position && it != opts.end()) { > target = *what; > + position = it; > + } > + // remove found optio

Re: [patch] fix bug 27

2007-12-03 Thread Uwe Stöhr
> I think there's a problem: the language switch is not static, it depends on > what the user defined as lyxrc.language_command_begin and > lyxrc.language_command_end. So you cannot assume (and hardcode) > \selectlanguage as the language switch, I haven't: When the LaTex file contains \selectlang

Re: [patch] fix bug 27

2007-12-03 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > Yes, it is a matter of interpreting latex code, not of inferring what > macro LyX might have used (if LyX produced the code...). I guess you're right. Jürgen

Re: [patch] fix bug 27

2007-12-03 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > Jean-Marc Lasgouttes wrote: >> tex2lyx can handle this too. > > you mean it should just handle \selectlanguage and the otherlanguage[*] > environments as a language switch, without differentiating further? > > On a second though: Maybe it should. A

Re: [patch] fix bug 27

2007-12-03 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > tex2lyx can handle this too. you mean it should just handle \selectlanguage and the otherlanguage[*] environments as a language switch, without differentiating further? On a second though: Maybe it should. After all, the language switch might also just change if yo

Re: [patch] fix bug 27

2007-12-03 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > Jean-Marc Lasgouttes wrote: >> I think it was introduced for hebrew/arabic. If our sources tell us it >> s not necessary anymore, it should be removed in 1.6. > > I vaguely remember having to use \begin{otherlanguage} ... > \end{otherlanguage} > i

Re: [patch] fix bug 27

2007-12-03 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > I think it was introduced for hebrew/arabic. If our sources tell us it > s not necessary anymore, it should be removed in 1.6. I vaguely remember having to use \begin{otherlanguage} ... \end{otherlanguage} in some contexts instead of \selectlanguage. > Moreover, for

Re: [patch] fix bug 27

2007-12-03 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > Jean-Marc Lasgouttes wrote: >> I would really like to find a way to get rid of the language switch in >> lyxrc. Do we have a clear idea of who uses it? > > I fear, we don't. I think it was introduced for hebrew/arabic. If our sources tell us it s n

Re: [patch] fix bug 27

2007-12-03 Thread Jean-Marc Lasgouttes
Uwe Stöhr <[EMAIL PROTECTED]> writes: > Take this patch with better code documentation instead. The patch looks very reasonable to me. A few comments below. > + // trim spaces around the options because this is valid LaTeX: > + // "12pt, bulgarian" > + // otherwise the option would be

Re: [patch] fix bug 27

2007-12-03 Thread Jürgen Spitzmüller
Jean-Marc Lasgouttes wrote: > I would really like to find a way to get rid of the language switch in > lyxrc. Do we have a clear idea of who uses it? I fear, we don't. Jürgen

Re: [patch] fix bug 27

2007-12-03 Thread Jean-Marc Lasgouttes
[EMAIL PROTECTED] (Jürgen Spitzmüller) writes: > Uwe Stöhr wrote: >> - The attached patch supports \selectlanguage etc. in tex2lyx. > > I think there's a problem: the language switch is not static, it depends on > what the user defined as lyxrc.language_command_begin and > lyxrc.language_command

Re: [patch] fix bug 27

2007-12-02 Thread Jürgen Spitzmüller
Uwe Stöhr wrote: > - The attached patch supports \selectlanguage etc. in tex2lyx. I think there's a problem: the language switch is not static, it depends on what the user defined as lyxrc.language_command_begin and lyxrc.language_command_end. So you cannot assume (and hardcode) \selectlanguage

Re: [patch] fix bug 27

2007-12-02 Thread Uwe Stöhr
Take this patch with better code documentation instead. regards Uwe Index: preamble.cpp === --- preamble.cpp (revision 21925) +++ preamble.cpp (working copy) @@ -3,7 +3,8 @@ * This file is part of LyX, the document processor. * L

[patch] fix bug 27

2007-12-02 Thread Uwe Stöhr
- The attached patch supports \selectlanguage etc. in tex2lyx. - To achieve this, it also enables to use more than one document language - To be LaTeX-conform, also support for this kind of option specifications is built in: \documentclass[12pt, bulgarian,italian,english]{article} Spaces are tr