Re: \lang ignore in ERT insets
On 01-Aug-2001 Asger K. Alstrup Nielsen wrote: On Wed, 1 Aug 2001, Dekel Tsur wrote: Let's look at the two reason why you added the language_inherit Juergen, I actually agreed with Dekel in this case. Let me try to explain why: [snip] Well I agree with both of you! I always said that language is NOT a font property. It should be split and there should be it's own handling! I also don't like the assumption of a paragraph-language based on the first character in the paragraph as paragraph-language should be declared as it and inserted in the paragraph-data. What I did is to make the whole stuff work in 1 buffer. It should be quite easy to fix the copy/paste stuff by just realizing the language on a copy operation so that the language in the copy-buffer is always realized! Then on paste operation you just can do a de-realize for the environment to copy it inside. Should be really easy! accept this solution and fix it up to work correctly. Dekel reproted that copypaste is currently broken, so something should be done. Sure and it's easy to fix, just I won't fix it now. I've a lot of other things to do and this is something I don't really care about! I made it work so that I could view a loaded document (this was not possible before) and so that the fileformat is ok and not filled over and over with \lang tags. That all I care about right now. If you, Dekel or someone else care about this NOW the I just have to tell you fix it yourself. I'll fix this eventually, but this is on the bottom of my quite long TODO list (see SF buglist!). Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ It's God. No, not Richard Stallman, or Linus Torvalds, but God. (By Matt Welsh)
Re: \lang ignore in ERT insets
On 02-Aug-2001 Jean-Marc Lasgouttes wrote: Asger Now, language is not an ortogonal properties of text. Instead, Asger it's a coupled property. You can not logically change the Asger language of the text without changing the text itself, and vice Asger versa. So what is the language of ERT? What is the language of some lyxcode or verbatim? For me it is just 'inherit'. Or maybe better 'ignore'. It should be ignore and they are right maybe the inherit is not needed at all, the problem that we have now is that the document_language is not known inside the LyXFont and so all this inherit_stuff for language is only a work around for the unknown document_language! Maybe this can be easily fixed by always realizing the language when saving the font in the font-vector of the paragraph! That would be he fastes fix for all our problems right now! So the inherit is only temporary until we save it in the paragraph then it gets it's REAL language till the end of times ;) Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Some people pray for more than they are willing to work for.
Re: "\lang ignore" in ERT insets
On 01-Aug-2001 Asger K. Alstrup Nielsen wrote: > On Wed, 1 Aug 2001, Dekel Tsur wrote: > >> Let's look at the two reason why you added the language_inherit > > Juergen, I actually agreed with Dekel in this case. > > Let me try to explain why: [snip] Well I agree with both of you! I always said that language is NOT a font property. It should be split and there should be it's own handling! I also don't like the assumption of a "paragraph-language" based on the first character in the paragraph as paragraph-language should be declared as it and inserted in the "paragraph-data". What I did is to make the whole stuff work in 1 buffer. It should be quite easy to fix the copy/paste stuff by just "realizing" the language on a copy operation so that the language in the copy-buffer is always realized! Then on paste operation you just can do a "de-realize" for the environment to copy it inside. Should be really easy! > accept this solution and fix it up to work correctly. Dekel reproted > that copy is currently broken, so something should be done. Sure and it's easy to fix, just I won't fix it now. I've a lot of other things to do and this is something I don't really care about! I made it work so that I could view a loaded document (this was not possible before) and so that the fileformat is ok and not filled over and over with \lang tags. That all I care about right now. If you, Dekel or someone else care about this NOW the I just have to tell you fix it yourself. I'll fix this eventually, but this is on the bottom of my quite long TODO list (see SF buglist!). Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ "It's God. No, not Richard Stallman, or Linus Torvalds, but God." (By Matt Welsh)
Re: "\lang ignore" in ERT insets
On 02-Aug-2001 Jean-Marc Lasgouttes wrote: > Asger> Now, language is not an ortogonal properties of text. Instead, > Asger> it's a coupled property. You can not logically change the > Asger> language of the text without changing the text itself, and vice > Asger> versa. > > So what is the language of ERT? What is the language of some > lyxcode or verbatim? For me it is just 'inherit'. Or maybe better > 'ignore'. It should be "ignore" and they are right maybe the inherit is not needed at all, the problem that we have now is that the "document_language" is not known inside the LyXFont and so all this inherit_stuff for language is only a work around for the unknown "document_language"! Maybe this can be easily fixed by always realizing the language when saving the font in the font-vector of the paragraph! That would be he fastes fix for all our problems right now! So the inherit is only temporary until we save it in the paragraph then it gets it's REAL language till the end of times ;) Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Some people pray for more than they are willing to work for.
Re: \lang ignore in ERT insets
On Mon, Jul 30, 2001 at 09:38:56AM +0200, Juergen Vigna wrote: Let's look at the two reason why you added the language_inherit 1) Consistency with other font properties 2) Previously, a special code was needed to set the language when creating an empty insettext. So the change simplifies the code I don't care about argument one. If you want a cleaner code than move the language (and also the emph field) out of LyXfont. As for the second argument, I don't think that language_inherit simplifies the code. Here is why: First, I don't know how you want to interpret language_inherit. Option a: If a text has language_inherit language then its language is the document language. Option b: If a text in insettext has language_inherit language, then its language is according to the language in the position of the inset in the paragraph above. If you use option-a, then you the use of language_inherit doesn't solve the problem of item 2 above: suppose that you want to create a tabular in a French paragraph in an English document. Then, when you enter an empty cell, you need to set the language to French! Now, suppose that you use option-b. The problem now is that you have a much more complicated copypaste code (actually, this happen also with option-a). Suppose that I have a tabular (in French) in a French paragraph in an English document. The text in the tabular has language_inherit language. Now if you copy some text from a cell, and paste it into an English paragraph, you need to change the language of the copied text to French! So the language_inherit saves you ~3 lines in the code, but adds 10 lines to the code of copypaste. This doesn't really simplifies the code!
Re: "\lang ignore" in ERT insets
On Mon, Jul 30, 2001 at 09:38:56AM +0200, Juergen Vigna wrote: > Let's look at the two reason why you added the language_inherit 1) Consistency with other font properties 2) Previously, a special code was needed to set the language when creating an empty insettext. So the change simplifies the code I don't care about argument one. If you want a cleaner code than move the language (and also the emph field) out of LyXfont. As for the second argument, I don't think that language_inherit simplifies the code. Here is why: First, I don't know how you want to interpret language_inherit. Option a: If a text has language_inherit language then its language is the document language. Option b: If a text in insettext has language_inherit language, then its language is according to the language in the position of the inset in the paragraph above. If you use option-a, then you the use of language_inherit doesn't solve the problem of item 2 above: suppose that you want to create a tabular in a French paragraph in an English document. Then, when you enter an empty cell, you need to set the language to French! Now, suppose that you use option-b. The problem now is that you have a much more complicated copy code (actually, this happen also with option-a). Suppose that I have a tabular (in French) in a French paragraph in an English document. The text in the tabular has language_inherit language. Now if you copy some text from a cell, and paste it into an English paragraph, you need to change the language of the copied text to French! So the language_inherit saves you ~3 lines in the code, but adds >10 lines to the code of copy This doesn't really simplifies the code!
Re: \lang ignore in ERT insets
On 28-Jul-2001 Dekel Tsur wrote: 1. When you copy text from English document to French document, the language of the text remains language_inherit, so the text will now be considered as French instead of English. When copying to the clipboard, you do need to store the language of the document, and when pasting from the clipboard, you need to do the necessary conversion if the language of the current document is different. Yes, this should be done! 2. For a text in insettext with language=language_inherit, the language of the text should be according to the paragraph above. However, currently the language of the text is according to the the document language. Yes we discussed this on Friday! I'm sure there are other problem, but I didn't check thoroughly. Sure there could be! I am a bit annoyed that you applied this patch without asking me first. Maybe you should revert it, and start a new branch. When you have a fully working code, we can see if the inherit_language really simplifies the code. Are you? I'm really sorry! But maybe instead of complaining you should have fixed the code yourself! Don't you think so! I surely will not revert the patch as now at least it IS working somehow! Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ If life isn't what you wanted, have you asked for anything else?
Re: "\lang ignore" in ERT insets
On 28-Jul-2001 Dekel Tsur wrote: > 1. When you copy text from English document to French document, the > language of the text remains language_inherit, so the text will now be > considered as French instead of English. > When copying to the clipboard, you do need to store the language of the > document, and when pasting from the clipboard, you need to do the necessary > conversion if the language of the current document is different. Yes, this should be done! > 2. For a text in insettext with language=language_inherit, the language > of the text should be according to the paragraph above. > However, currently the language of the text is according to the > the document language. Yes we discussed this on Friday! > I'm sure there are other problem, but I didn't check thoroughly. Sure there could be! > I am a bit annoyed that you applied this patch without asking me first. > Maybe you should revert it, and start a new branch. When you have a fully > working code, we can see if the inherit_language really simplifies the code. Are you? I'm really sorry! But maybe instead of complaining you should have fixed the code yourself! Don't you think so! I surely will not revert the patch as now at least it IS working somehow! Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ If life isn't what you wanted, have you asked for anything else?
Re: \lang ignore in ERT insets
On Fri, Jul 27, 2001 at 03:03:07PM +0200, Juergen Vigna wrote: We didn't need inherit language before, so we don't need one now. You surely meant we didn't have an inherit_language before and we have seen we need one so that all of it is working correctly, isn't it? Up until a week ago we didn't need language_inherit, and I don't see why wee need one now. There is currently many problems with your changes: 1. When you copy text from English document to French document, the language of the text remains language_inherit, so the text will now be considered as French instead of English. When copying to the clipboard, you do need to store the language of the document, and when pasting from the clipboard, you need to do the necessary conversion if the language of the current document is different. 2. For a text in insettext with language=language_inherit, the language of the text should be according to the paragraph above. However, currently the language of the text is according to the the document language. I'm sure there are other problem, but I didn't check thoroughly. I am a bit annoyed that you applied this patch without asking me first. Maybe you should revert it, and start a new branch. When you have a fully working code, we can see if the inherit_language really simplifies the code.
Re: "\lang ignore" in ERT insets
On Fri, Jul 27, 2001 at 03:03:07PM +0200, Juergen Vigna wrote: > > We didn't need inherit language before, so we don't need one now. > > You surely meant we didn't have an inherit_language before and we have > seen we need one so that all of it is working correctly, isn't it? Up until a week ago we didn't need language_inherit, and I don't see why wee need one now. There is currently many problems with your changes: 1. When you copy text from English document to French document, the language of the text remains language_inherit, so the text will now be considered as French instead of English. When copying to the clipboard, you do need to store the language of the document, and when pasting from the clipboard, you need to do the necessary conversion if the language of the current document is different. 2. For a text in insettext with language=language_inherit, the language of the text should be according to the paragraph above. However, currently the language of the text is according to the the document language. I'm sure there are other problem, but I didn't check thoroughly. I am a bit annoyed that you applied this patch without asking me first. Maybe you should revert it, and start a new branch. When you have a fully working code, we can see if the inherit_language really simplifies the code.
Re: \lang ignore in ERT insets
On 27-Jul-2001 Jean-Marc Lasgouttes wrote: And it should probably not be output in the .lyx file. Probably a few changes in lyxfont.C will be enough. It HAS to be outputed, BUT as the document_wide language, otherwise we're not able to switch back and remain in the previously defined language! BTW.: A question to our Font-experts. If I have INHERIT as font property WHERE do I inherit the stuff from? From the default? Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Somewhere in DOWNTOWN BURBANK a prostitute is OVERCOOKING a LAMB CHOP!!
Re: \lang ignore in ERT insets
On Fri, Jul 27, 2001 at 12:03:04PM +0200, Juergen Vigna wrote: On 27-Jul-2001 Jean-Marc Lasgouttes wrote: And it should probably not be output in the .lyx file. Probably a few changes in lyxfont.C will be enough. It HAS to be outputed, BUT as the document_wide language, otherwise we're not able to switch back and remain in the previously defined language! Why the language in insetERT is changed to ignore_language ??? The correct way for implementing insetERT is to have an InsetEditor and use it instead of insetText. Currently, I think that the cleanest solution is to set the language inside inserERT to the language of the document. Also, when converting the old insetInfo to an insetNote, the language in the inset should be set to the language of the document (or maybe to the language of current paragraph ??), except when that language is a RTL language (Hebrew/Arabic), and in that case the language should be set to English. Another problem with insetERT is that it generates the following lines in the .lyx file: \family typewriter \color latex A possible solution is to write an InsetERT::write method, which just writes the text in the inset paragraphs (replacing \ by \backslash etc.).
Re: \lang ignore in ERT insets
On 27-Jul-2001 Dekel Tsur wrote: Why the language in insetERT is changed to ignore_language ??? No your're right it should be inherit_language and now it is! The correct way for implementing insetERT is to have an InsetEditor and use Your free to provide one! it instead of insetText. Currently, I think that the cleanest solution is to set the language inside inserERT to the language of the document. Well no not really, but yes, inherit_language is exactly that it's the language of the document! Another problem with insetERT is that it generates the following lines in the .lyx file: \family typewriter \color latex Why is this a problem it should do that! Anyway now that I cleaned this language stuff a bit, I'm more and more of the opinion that it is a big hack and we need other hacks to go around some problems! Language should NOT be in LyXFont it should be appart and it should be initialized (constructor) with the document_languange as default language so that we always know what's the default and don't have to go back to the bufferparams. Obviously this is not so easy and as we have it now it's, ..., well, ..., it's working. Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ The three best things about going to school are June, July, and August.
Re: \lang ignore in ERT insets
On 27-Jul-2001 Jean-Marc Lasgouttes wrote: The interesting methods in LyX Font are /** Reduce font to fall back to template where possible. Equal fields are reduced to INHERIT */ void reduce(LyXFont const tmplt); /// Realize font from a template (INHERIT are realized) LyXFont realize(LyXFont const tmplt); Well I've seen them but where do we get the template from? Well I know that too it's just the it seems to me that the whole language stuff and inherit ignore or whatever is a bit (not to say more) hackish. I think that an insettext should have a base font (where the color and language and other things would be given) and the text in the inset text should be reduce()'d against that. So the font properties would be properties of the inset and not of the font. But we have this it's just not handled right now. You'll see that we have a LyXFont parameter for some functions. But maybe you're right the inset should have a Font and a setFont(LyXFont) method which set's the font of that inset (without the need to ask the owner what font-environment we're inside!) and when we have a fontchange and at that character position is an inset the font should be set also inside the inset with the above call. This done we don't need the fontparameter of the various draw, ascent, ... methods as we always know our font and can then handle it in the various export or write methods. Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Peers's Law: The solution to a problem changes the nature of the problem.
Re: \lang ignore in ERT insets
On Fri, Jul 27, 2001 at 02:15:56PM +0200, Jean-Marc Lasgouttes wrote: Dekel Why the language in insetERT is changed to ignore_language ??? We need a way to say inherit language. This works well for everything in a font when one specifies ALL_INHERIT, _except_ for language. Why? Because the language property is not inherited. If you write some text in an English document, and then copy it to a French document, the language of the text should remain English (there are exceptions if for example you copy source code). Dekel The correct way for implementing insetERT is to have an Dekel InsetEditor and use it instead of insetText. Currently, I think Dekel that the cleanest solution is to set the language inside Dekel inserERT to the language of the document. No, we need an inherit setting for language, but since we do not have a default language anymore, it seemed that ignore was right. However the code in lyxfont probably has to be teaked to handle that. We didn't need inherit language before, so we don't need one now. You only want to set some language for the text in insetert, and I think that the cleanest way is to use the document language (you won't need to change lyxfont.C). Dekel Also, when converting the old insetInfo to an insetNote, the Dekel language in the inset should be set to the language of the Dekel document (or maybe to the language of current paragraph ??), Dekel except when that language is a RTL language (Hebrew/Arabic), Dekel and in that case the language should be set to English. No, the language should be transparent in some way. And having special What do you mean by transparent ? BTW, Dekel, what is the reason why there are plenty comparison of language to hebrew in the code? Shouldn't these places test for RTL instead? Such hardcoding is a bit wrong IMO. We only support Hebrew and Arabic, and the Arabic support is a little different as Arabtex doesn't use babel. I guess that instead of checking whether language-lang() == hebrew we should do 'language-rtl() !using_arabtex). I'll look into it when I find some spare time...
Re: \lang ignore in ERT insets
On 27-Jul-2001 Dekel Tsur wrote: Because the language property is not inherited. If you write some text in an English document, and then copy it to a French document, the language of the text should remain English (there are exceptions if for example you copy source code). You're right we wouldn't need it if we would have a clean implementation, but as we have implemented it with LyXFont and lyfont has this state to we have to support it too (and do now). We didn't need inherit language before, so we don't need one now. You surely meant we didn't have an inherit_language before and we have seen we need one so that all of it is working correctly, isn't it? You only want to set some language for the text in insetert, and I think that the cleanest way is to use the document language (you won't need to change lyxfont.C). Sure and add the bufferparams and/or the bufferparams.language too all function where we work with fonts (including LyXFont operator== etc.) that would be the cleanest way if we have it in LyXFont, sure! What do you mean by transparent ? Invisible? We only support Hebrew and Arabic, and the Arabic support is a little different as Arabtex doesn't use babel. I guess that instead of checking whether language-lang() == hebrew we should do 'language-rtl() !using_arabtex). I'll look into it when I find some spare time... Sure and please have also a look at the spots where I put a warning for you so that RTL text is working there too. Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Do not underestimate the power of the Force.
Re: "\lang ignore" in ERT insets
On 27-Jul-2001 Jean-Marc Lasgouttes wrote: > And it should probably not be output in the .lyx file. Probably a few > changes in lyxfont.C will be enough. It HAS to be outputed, BUT as the document_wide language, otherwise we're not able to switch back and remain in the previously defined language! BTW.: A question to our Font-experts. If I have INHERIT as font property WHERE do I inherit the stuff from? From the default? Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Somewhere in DOWNTOWN BURBANK a prostitute is OVERCOOKING a LAMB CHOP!!
Re: "\lang ignore" in ERT insets
On Fri, Jul 27, 2001 at 12:03:04PM +0200, Juergen Vigna wrote: > > On 27-Jul-2001 Jean-Marc Lasgouttes wrote: > > > And it should probably not be output in the .lyx file. Probably a few > > changes in lyxfont.C will be enough. > > It HAS to be outputed, BUT as the document_wide language, otherwise we're > not able to switch back and remain in the previously defined language! Why the language in insetERT is changed to ignore_language ??? The correct way for implementing insetERT is to have an InsetEditor and use it instead of insetText. Currently, I think that the cleanest solution is to set the language inside inserERT to the language of the document. Also, when converting the old insetInfo to an insetNote, the language in the inset should be set to the language of the document (or maybe to the language of current paragraph ??), except when that language is a RTL language (Hebrew/Arabic), and in that case the language should be set to English. Another problem with insetERT is that it generates the following lines in the .lyx file: \family typewriter \color latex A possible solution is to write an InsetERT::write method, which just writes the text in the inset paragraphs (replacing \ by \backslash etc.).
Re: "\lang ignore" in ERT insets
On 27-Jul-2001 Dekel Tsur wrote: > Why the language in insetERT is changed to ignore_language ??? No your're right it should be inherit_language and now it is! > The correct way for implementing insetERT is to have an InsetEditor and use Your free to provide one! > it instead of insetText. Currently, I think that the cleanest solution is to > set the language inside inserERT to the language of the document. Well no not really, but yes, inherit_language is exactly that it's the language of the document! > Another problem with insetERT is that it generates the following lines in > the .lyx file: > \family typewriter > \color latex Why is this a problem it should do that! Anyway now that I cleaned this language stuff a bit, I'm more and more of the opinion that it is a big hack and we need other hacks to go around some problems! Language should NOT be in LyXFont it should be appart and it should be initialized (constructor) with the document_languange as default language so that we always know what's the default and don't have to go back to the bufferparams. Obviously this is not so easy and as we have it now it's, ..., well, ..., it's working. Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ The three best things about going to school are June, July, and August.
Re: "\lang ignore" in ERT insets
On 27-Jul-2001 Jean-Marc Lasgouttes wrote: > The interesting methods in LyX Font are > > /** Reduce font to fall back to template where possible. > Equal fields are reduced to INHERIT */ > void reduce(LyXFont const & tmplt); > > /// Realize font from a template (INHERIT are realized) > LyXFont & realize(LyXFont const & tmplt); Well I've seen them but where do we get the template from? Well I know that too it's just the it seems to me that the whole language stuff and inherit ignore or whatever is a bit (not to say more) hackish. > I think that an insettext should have a base font (where the color and > language and other things would be given) and the text in the inset > text should be reduce()'d against that. So the font properties would > be properties of the inset and not of the font. But we have this it's just not handled right now. You'll see that we have a LyXFont parameter for some functions. But maybe you're right the inset should have a Font and a setFont(LyXFont) method which set's the font of that inset (without the need to ask the owner what font-environment we're inside!) and when we have a fontchange and at that character position is an inset the font should be set also inside the inset with the above call. This done we don't need the fontparameter of the various draw, ascent, ... methods as we always know our font and can then handle it in the various export or write methods. Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Peers's Law: The solution to a problem changes the nature of the problem.
Re: "\lang ignore" in ERT insets
On Fri, Jul 27, 2001 at 02:15:56PM +0200, Jean-Marc Lasgouttes wrote: > Dekel> Why the language in insetERT is changed to ignore_language ??? > > We need a way to say inherit language. This works well for everything > in a font when one specifies ALL_INHERIT, _except_ for language. Why? Because the language property is not inherited. If you write some text in an English document, and then copy it to a French document, the language of the text should remain English (there are exceptions if for example you copy source code). > Dekel> The correct way for implementing insetERT is to have an > Dekel> InsetEditor and use it instead of insetText. Currently, I think > Dekel> that the cleanest solution is to set the language inside > Dekel> inserERT to the language of the document. > > No, we need an inherit setting for language, but since we do not have > a "default" language anymore, it seemed that ignore was right. > However the code in lyxfont probably has to be teaked to handle that. We didn't need inherit language before, so we don't need one now. You only want to set some language for the text in insetert, and I think that the cleanest way is to use the document language (you won't need to change lyxfont.C). > Dekel> Also, when converting the old insetInfo to an insetNote, the > Dekel> language in the inset should be set to the language of the > Dekel> document (or maybe to the language of current paragraph ??), > Dekel> except when that language is a RTL language (Hebrew/Arabic), > Dekel> and in that case the language should be set to English. > > No, the language should be transparent in some way. And having special What do you mean by transparent ? > BTW, Dekel, what is the reason why there are plenty comparison of > language to "hebrew" in the code? Shouldn't these places test for RTL > instead? Such hardcoding is a bit wrong IMO. We only support Hebrew and Arabic, and the Arabic support is a little different as Arabtex doesn't use babel. I guess that instead of checking whether language->lang() == "hebrew" we should do 'language->rtl() && !using_arabtex). I'll look into it when I find some spare time...
Re: "\lang ignore" in ERT insets
On 27-Jul-2001 Dekel Tsur wrote: > Because the language property is not inherited. > If you write some text in an English document, and then copy it to a French > document, the language of the text should remain English (there are > exceptions if for example you copy source code). You're right we wouldn't need it if we would have a clean implementation, but as we have implemented it with LyXFont and lyfont has this state to we have to support it too (and do now). > We didn't need inherit language before, so we don't need one now. You surely meant we didn't have an inherit_language before and we have seen we need one so that all of it is working correctly, isn't it? > You only want to set some language for the text in insetert, and I think > that the cleanest way is to use the document language (you won't need to > change lyxfont.C). Sure and add the bufferparams and/or the bufferparams.language too all function where we work with fonts (including LyXFont operator== etc.) that would be the cleanest way if we have it in LyXFont, sure! > What do you mean by transparent ? Invisible? > We only support Hebrew and Arabic, and the Arabic support is a little > different as Arabtex doesn't use babel. > I guess that instead of checking whether language->lang() == "hebrew" > we should do 'language->rtl() && !using_arabtex). > I'll look into it when I find some spare time... Sure and please have also a look at the spots where I put a warning for you so that RTL text is working there too. Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Do not underestimate the power of the Force.
RE: \lang ignore in ERT insets
On 25-Jul-2001 Mike Ressler wrote: I'm converting the docs from 1.1.6 to 1.2.0. When trying to translate the UG, the conversion of the LaTeX code in Chapter 7 to an inset failed (or at least complained) as expected. What I didn't expect was that all the text in the inset was underlined blue, indicating a language change. Indeed, when I opened UG with emacs, I found that all ERT insets had a \lang ignore directive, which Lyx complains about when opening the file, as it is an unknown language. I've stripped out those \lang directives in emacs, and now the file loads fine in today's CVS. What's the deal? This seems strange to me as it seems I changed the code in text.C so that the font of a ignore language is not displayed as different! Ignore should always use the document-wide language and so it shouldn't do that. I'll have a look at this! Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ *** System shutdown message from root *** System going down in 60 seconds
Re: \lang ignore in ERT insets
Juergen Vigna wrote: I've stripped out those \lang directives in emacs, and now the file loads fine in today's CVS. What's the deal? This seems strange to me as it seems I changed the code in text.C so that the font of a ignore language is not displayed as different! Ignore should always use the document-wide language and so it shouldn't do that. I'll have a look at this! because it becomes blue underlined, means different language ... Herbert -- http://www.educat.hu-berlin.de/~voss/lyx/
RE: "\lang ignore" in ERT insets
On 25-Jul-2001 Mike Ressler wrote: > I'm converting the docs from 1.1.6 to 1.2.0. When trying to translate the > UG, the conversion of the LaTeX code in Chapter 7 to an inset failed (or > at least complained) as expected. What I didn't expect was that all the > text in the inset was underlined blue, indicating a language change. > Indeed, when I opened UG with emacs, I found that all ERT insets had a > "\lang ignore" directive, which Lyx complains about when opening the file, > as it is an unknown language. > > I've stripped out those \lang directives in emacs, and now the file loads > fine in today's CVS. What's the deal? This seems strange to me as it seems I changed the code in text.C so that the font of a "ignore" language is not displayed as different! Ignore should always use the document-wide language and so it shouldn't do that. I'll have a look at this! Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ *** System shutdown message from root *** System going down in 60 seconds
Re: "\lang ignore" in ERT insets
Juergen Vigna wrote: > > > I've stripped out those \lang directives in emacs, and now the file loads > > fine in today's CVS. What's the deal? > > This seems strange to me as it seems I changed the code in text.C so that > the font of a "ignore" language is not displayed as different! Ignore should > always use the document-wide language and so it shouldn't do that. I'll have > a look at this! because it becomes blue underlined, means different language ... Herbert -- http://www.educat.hu-berlin.de/~voss/lyx/