On Wednesday 04 June 2003 17:47, Angus Leeming wrote:
> Jose' Matos wrote:
>
> I don't claim to understand the magic that lyx2lyx uses here.

  I am asking what is the criterion for the version jump. I elaborate this 
bellow.

> Which bit shouldn't be bumped? lyx2lyx or buffer.C?
>
> Why doesn't it read the format of the incoming file (223) and compare it to
> the final, desired format (224)?

  Yes, it can, but that is not the present behaviour.
  For the present scheme to work you need to create a new file 
lyxconvert_223.py and put there the convertion stuff.

  That would be great, mostly one (temporal) related change for each 
convertion file. And I agree with that. That would allow us to never have 
problems with development file formats. Last time we discussed that it was 
pointed that the drawback is the huge number of convertion files in the 
lyx2lyx directory (we can change the magic to restrict it to one file per 
develpment cycle if needed).

  My question remains, why to change now?  Was that intentional?
  Notice that I am not against it, if we decide that this is the way to go, 
good, you have my vote.

> If different, run it through the closest
> lyxconvert_ABC.py (where ABC is the first one below 223) to the end of the
> list of lyxconvert_XYZ.py it has in its list?

  I can point you problems with that approach. We would need to complicate the 
convertion code unnecessary, IMO.

> Anyway, tell me what to do and I'll do it.
>
> Index: lib/lyx2lyx/lyx2lyx
> ===================================================================
>  fileformat = re.compile(r"\\lyxformat\s*(\S*)")
> -lst_ft = ["210", "215", "216", "217", "218", "220", "221", "223"]
> +lst_ft = ["210", "215", "216", "217", "218", "220", "221", "224"]

If you add the new file lyxconvert_223.py with solely the new stuff and add 
"223" between "221" and "224" all should work. That simple.

> Index: src/buffer.C
> ===================================================================
>  namespace {
>
> -const int LYX_FORMAT = 223;
> +const int LYX_FORMAT = 224;

  No problem here.
-- 
José Abílio

Reply via email to