Re: babelCall strange logic

2007-05-13 Thread Jean-Marc Lasgouttes
Andre == Andre Poenitz [EMAIL PROTECTED] writes: Andre On Fri, May 11, 2007 at 01:12:14AM +0200, Uwe Stöhr wrote: - } - return lang_pack; + } else + return lang_pack; } Andre Everytime I see Andre if (...) { ... } else return ...; Andre I get the feeling that it'd better changed to Andre

Re: babelCall strange logic

2007-05-13 Thread Jean-Marc Lasgouttes
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes: Andre> On Fri, May 11, 2007 at 01:12:14AM +0200, Uwe Stöhr wrote: >> - } - return lang_pack; + } else + return lang_pack; >> } Andre> Everytime I see Andre> if (...) { ... } else return ...; Andre> I get the feeling that it'd better

Re: babelCall strange logic

2007-05-11 Thread Andre Poenitz
On Fri, May 11, 2007 at 01:12:14AM +0200, Uwe Stöhr wrote: - } - return lang_pack; + } else + return lang_pack; } Everytime I see if (...) { ... } else return ...; I get the feeling that it'd better changed to

Re: babelCall strange logic

2007-05-11 Thread Abdelrazak Younes
Andre Poenitz wrote: On Fri, May 11, 2007 at 01:12:14AM +0200, Uwe Stöhr wrote: - } - return lang_pack; + } else + return lang_pack; } Everytime I see if (...) { ... } else return ...; I get the feeling that

Re: babelCall strange logic

2007-05-11 Thread Abdelrazak Younes
Uwe Stöhr wrote: Index: BufferParams.cpp === --- BufferParams.cpp(revision 18260) +++ BufferParams.cpp(working copy) @@ -867,7 +867,7 @@ language_options ',';

Re: babelCall strange logic

2007-05-11 Thread Uwe Stöhr
@@ -1412,15 +1412,15 @@ if (lang_pack == \\usepackage{babel}) { - if (lang_pack == \\usepackage{babel}) { + if (lang_pack != \\usepackage{babel}) + return lang_pack; // suppress the babel call when there is no babel language

Re: babelCall strange logic

2007-05-11 Thread Andre Poenitz
On Fri, May 11, 2007 at 01:12:14AM +0200, Uwe Stöhr wrote: > - } > - return lang_pack; > + } else > + return lang_pack; > } Everytime I see if (...) { ... } else return ...; I get the feeling that it'd better changed to

Re: babelCall strange logic

2007-05-11 Thread Abdelrazak Younes
Andre Poenitz wrote: On Fri, May 11, 2007 at 01:12:14AM +0200, Uwe Stöhr wrote: - } - return lang_pack; + } else + return lang_pack; } Everytime I see if (...) { ... } else return ...; I get the feeling that

Re: babelCall strange logic

2007-05-11 Thread Abdelrazak Younes
Uwe Stöhr wrote: Index: BufferParams.cpp === --- BufferParams.cpp(revision 18260) +++ BufferParams.cpp(working copy) @@ -867,7 +867,7 @@ language_options << ',';

Re: babelCall strange logic

2007-05-11 Thread Uwe Stöhr
>>@@ -1412,15 +1412,15 @@ >> >>if (lang_pack == "\\usepackage{babel}") { > > - if (lang_pack == "\\usepackage{babel}") { > + if (lang_pack != "\\usepackage{babel}") > + return lang_pack; > >>// suppress the babel call when there is no

Re: babelCall strange logic

2007-05-10 Thread Jean-Marc Lasgouttes
Uwe == Uwe Stöhr [EMAIL PROTECTED] writes: Uwe Jean-Marc Lasgouttes schrieb: I hope it is OK now. See my answer to your first commit. Uwe Then I simply don't understand what you want. The current Uwe solution is the cleanest possible and it works. You must check at Uwe least once if the

Re: babelCall strange logic

2007-05-10 Thread José Matos
On Wednesday 09 May 2007 22:30:50 Jean-Marc Lasgouttes wrote: See my answer to your first commit. I do not want to repeat myself, but posting code is often better than just committing. Uwe please follow the guidelines, we are all posting to the list before committing. This is particularly

Re: babelCall strange logic

2007-05-10 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: Let me say it again: you have the following test: if (language-babel().empty() lang_opts.empty()) What is in lang_opts? There is the language of the document (language-babel()), plus some other things (languages used in other places of the text). Now

Re: babelCall strange logic

2007-05-10 Thread Jean-Marc Lasgouttes
> "Uwe" == Uwe Stöhr <[EMAIL PROTECTED]> writes: Uwe> Jean-Marc Lasgouttes schrieb: >>> I hope it is OK now. >> See my answer to your first commit. Uwe> Then I simply don't understand what you want. The current Uwe> solution is the cleanest possible and it works. You must check at Uwe>

Re: babelCall strange logic

2007-05-10 Thread José Matos
On Wednesday 09 May 2007 22:30:50 Jean-Marc Lasgouttes wrote: > See my answer to your first commit. I do not want to repeat myself, but > posting code is often better than just committing. Uwe please follow the guidelines, we are all posting to the list before committing. This is

Re: babelCall strange logic

2007-05-10 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: Let me say it again: you have the following test: if (language->babel().empty() && lang_opts.empty()) What is in lang_opts? There is the language of the document (language->babel()), plus some other things (languages used in other places of the text). Now

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: Uwe This won't work. Attached is my proposal. What won't work? You don't check if there is an empty babel language. Why do you insist on testing language-babel()? Because that was the reason for my changes. Since the patch for bug 3043 is in, we now support

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Uwe Stöhr a écrit : Jean-Marc Lasgouttes schrieb: Uwe This won't work. Attached is my proposal. What won't work? You don't check if there is an empty babel language. The list of languages passed to babelCall contains the main language. So if the list is empty, the main language does not

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: The list of languages passed to babelCall contains the main language. So if the list is empty, the main language does not need babel either. Yes, but with the code we had before my changes, babel was called in any case. I now applied this clean solution, after I

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Uwe Stöhr a écrit : Yes, but with the code we had before my changes, babel was called in any case. I now applied this clean solution, after I tested it well of course: http://www.lyx.org/trac/changeset/18251 (and http://www.lyx.org/trac/changeset/18252) If you want to have another string

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: I hope it is OK now. See my answer to your first commit. Then I simply don't understand what you want. The current solution is the cleanest possible and it works. You must check at least once if the babel language is empty to clear lang_pack, otherwise babel

babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Currently, BufferParams::babelCall reads like: string const BufferParams::babelCall(string const lang_opts) const { string tmp = lyxrc.language_package; if (!lyxrc.language_global_options tmp == \\usepackage{babel}) tmp = string(\\usepackage[) + lang_opts +

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Uwe, I do not understand why lang_opts is passed to babel in the second if() when lyxrc.language_global_options is true. What was your intention? When lyxrc.language_global_options is true babel is not called when the document language has an empty babel language. But babel is called when

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Uwe == Uwe Stöhr [EMAIL PROTECTED] writes: Uwe, I do not understand why lang_opts is passed to babel in the second if() when lyxrc.language_global_options is true. What was your intention? Uwe When lyxrc.language_global_options is true babel is not called Uwe when the document language has

Re: babelCall strange logic

2007-05-09 Thread Herbert Voss
Jean-Marc Lasgouttes wrote: Uwe == Uwe Stöhr [EMAIL PROTECTED] writes: Uwe, I do not understand why lang_opts is passed to babel in the second if() when lyxrc.language_global_options is true. What was your intention? Uwe When lyxrc.language_global_options is true babel is not called Uwe

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: Note that the meaning of this variable is to decide whether the languages should be passed as... I know this difference but didn't touched the first case yet although I know it. I first wanted to assure that the current solution works and so could reduce my

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Uwe == Uwe Stöhr [EMAIL PROTECTED] writes: Uwe Jean-Marc Lasgouttes schrieb: Note that the meaning of this variable is to decide whether the languages should be passed as... Uwe I know this difference but didn't touched the first case yet Uwe although I know it. I first wanted to assure that

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Herbert == Herbert Voss [EMAIL PROTECTED] writes: Herbert there is a third variant to prevent an option clash if Herbert another package already loads babel (same for other packages) Herbert \PassOptionsToPackage{lang1,lang2}{babel} Herbert before \documentclass Indeed, thanks. BTW, it is

Re: babelCall strange logic

2007-05-09 Thread Herbert Voss
Jean-Marc Lasgouttes wrote: Herbert == Herbert Voss [EMAIL PROTECTED] writes: Herbert there is a third variant to prevent an option clash if Herbert another package already loads babel (same for other packages) Herbert \PassOptionsToPackage{lang1,lang2}{babel} Herbert before

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: I propose the following to both correct and simplify your code. This won't work. Attached is my proposal. regards Uwe Index: src/BufferParams.cpp === --- src/BufferParams.cpp (révision 18240) +++

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Uwe == Uwe Stöhr [EMAIL PROTECTED] writes: Uwe Jean-Marc Lasgouttes schrieb: I propose the following to both correct and simplify your code. Uwe This won't work. Attached is my proposal. What won't work? Why do you insist on testing language-babel()? JMarc

babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Currently, BufferParams::babelCall reads like: string const BufferParams::babelCall(string const & lang_opts) const { string tmp = lyxrc.language_package; if (!lyxrc.language_global_options && tmp == "\\usepackage{babel}") tmp = string("\\usepackage[") + lang_opts

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
> Uwe, I do not understand why lang_opts is passed to babel in the > second if() when lyxrc.language_global_options is true. What was your > intention? When lyxrc.language_global_options is true babel is not called when the document language has an empty babel language. But babel is called when

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
> "Uwe" == Uwe Stöhr <[EMAIL PROTECTED]> writes: >> Uwe, I do not understand why lang_opts is passed to babel in the >> second if() when lyxrc.language_global_options is true. What was >> your intention? Uwe> When lyxrc.language_global_options is true babel is not called Uwe> when the

Re: babelCall strange logic

2007-05-09 Thread Herbert Voss
Jean-Marc Lasgouttes wrote: >> "Uwe" == Uwe Stöhr <[EMAIL PROTECTED]> writes: > >>> Uwe, I do not understand why lang_opts is passed to babel in the >>> second if() when lyxrc.language_global_options is true. What was >>> your intention? > > Uwe> When lyxrc.language_global_options is true

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: Note that the meaning of this variable is to decide whether the languages should be passed as... I know this difference but didn't touched the first case yet although I know it. I first wanted to assure that the current solution works and so could reduce my

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
> "Uwe" == Uwe Stöhr <[EMAIL PROTECTED]> writes: Uwe> Jean-Marc Lasgouttes schrieb: >> Note that the meaning of this variable is to decide whether the >> languages should be passed as... Uwe> I know this difference but didn't touched the first case yet Uwe> although I know it. I first wanted

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
> "Herbert" == Herbert Voss <[EMAIL PROTECTED]> writes: Herbert> there is a third variant to prevent an option clash if Herbert> another package already loads babel (same for other packages) Herbert> \PassOptionsToPackage{lang1,lang2}{babel} Herbert> before \documentclass Indeed, thanks.

Re: babelCall strange logic

2007-05-09 Thread Herbert Voss
Jean-Marc Lasgouttes wrote: >> "Herbert" == Herbert Voss <[EMAIL PROTECTED]> writes: > > Herbert> there is a third variant to prevent an option clash if > Herbert> another package already loads babel (same for other packages) > > Herbert> \PassOptionsToPackage{lang1,lang2}{babel} > >

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: I propose the following to both correct and simplify your code. This won't work. Attached is my proposal. regards Uwe Index: src/BufferParams.cpp === --- src/BufferParams.cpp (révision 18240) +++

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
> "Uwe" == Uwe Stöhr <[EMAIL PROTECTED]> writes: Uwe> Jean-Marc Lasgouttes schrieb: >> I propose the following to both correct and simplify your code. Uwe> This won't work. Attached is my proposal. What won't work? Why do you insist on testing language->babel()? JMarc

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: Uwe> This won't work. Attached is my proposal. What won't work? You don't check if there is an empty babel language. Why do you insist on testing language->babel()? Because that was the reason for my changes. Since the patch for bug 3043 is in, we now

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Uwe Stöhr a écrit : Jean-Marc Lasgouttes schrieb: Uwe> This won't work. Attached is my proposal. What won't work? You don't check if there is an empty babel language. The list of languages passed to babelCall contains the main language. So if the list is empty, the main language does not

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: The list of languages passed to babelCall contains the main language. So if the list is empty, the main language does not need babel either. Yes, but with the code we had before my changes, babel was called in any case. I now applied this clean solution, after I

Re: babelCall strange logic

2007-05-09 Thread Jean-Marc Lasgouttes
Uwe Stöhr a écrit : Yes, but with the code we had before my changes, babel was called in any case. I now applied this clean solution, after I tested it well of course: http://www.lyx.org/trac/changeset/18251 (and http://www.lyx.org/trac/changeset/18252) If you want to have another string

Re: babelCall strange logic

2007-05-09 Thread Uwe Stöhr
Jean-Marc Lasgouttes schrieb: I hope it is OK now. See my answer to your first commit. Then I simply don't understand what you want. The current solution is the cleanest possible and it works. You must check at least once if the babel language is empty to clear "lang_pack", otherwise