On Thu, 2006-02-23 at 21:44 +0100, Georg Baum wrote:
> Am Donnerstag, 23. Februar 2006 18:39 schrieb Martin Vermeer:
> > On Thu, Feb 23, 2006 at 06:29:05PM +0100, Jean-Marc Lasgouttes wrote:
> > > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> > > 
> > > >> I did not try the other part.
> > > 
> > > Martin> But that's the actual bug fix! This part is just cosmetic (and
> > > Martin> I have no strong feelings on it, except that the blue line
> > > Martin> might be confusing for some users.)
> > > 
> > > I know :) But I do not have much time right now. And it is for 1.4.1,
> > > right?
> > 
> > No, I would say it's for 1.4.0: we have to prevent a format change.
> 
> I would not call it a format change. I would rather say that LyX can 
> produce invalid files currently. These invalid files can only be fixed 
> with a text editor, not from within LyX.
> 
> > Current 1.4.0svn writes out ERT insets in the buffer language rather
> > than latex_language, but the user doesn't notice until it's too late.
> > 
> > (Georg: correct me if I am wrong on this)
> 
> What you describe is correct, but the fix is not. If fonts in the 
> constructor are changed they should be changed in init(), so that it is 
> done in all constructors. Unfortunately even this is not enough. Load the 
> attached file, and change the document language to english. You will see 
> that everything (including the ERT contents) has the blue underline.
> The reason is that the default paragraph language is the buffer language, 
> and this is used in read() because there is no explicit language set.
> I extended your patch, now the language of ERT content is always forced to 
> "latex".
> I don't like this special language, and I don't like all these silly 
> attempts to enforce "no text parameters" in ERT insets, but I don't see a 
> better fix right now.
> One other possibility would be to always enforce buffer langauge, but that 
> would be mnore fragile, because one would always need to touch all ERT 
> insets when it changes.
> ERT contents should really be stored in a std::string in the long term, 
> but that would be too risky to do now.

Hmmm... does this cover the case where you create an ERT, insert some
text, delete this text again and insert some new text? My patch places a
current_cursor stanza into doDispatch/default for this. If you do this,
you can again dump the corresponding stanza in init().

Your read() stuff looks like it is needed and correct.

- Martin

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to