On Monday 10 September 2007 15:44:00 Bo Peng wrote:
> > > Two suggestions:
> > >   - include the manifest in the header. Possibly it can be place before
> > > the preamble although the order is irrelevant.
> >
> > This will lead to more work in .cpp. I will see.
>
> Looking at the code in Buffer.cpp, I do not think this is a good idea:
>
> Write:
>       // now write out the buffer parameters.
>       ofs << "\\begin_header\n";
>       params().writeFile(ofs);
>       ofs << "\\end_header\n";
>
> Read:
>       while (lex.isOK()) {
>       string unknown = params().readToken(lex, token);
>               if (!unknown.empty()) {
>
> You can see that header <==> params() so unless I move embedded_files_
> to params(), this does not look right.

  I know and that is my point. :-)
  Do you disagree?

> If you do not like version testing in LyX.py, the attached version
> moves this to lyx_1_6.py,

  You guessed right. :-)

> in LyX.py:
>
> +        # LyX file format <= 284 does not have a manifest section
> +        # so this section is set to None
> +        if self.manifest is None:
> +            manifest = []
> +        else:
> +            manifest = ['\\begin_manifest'] + self.manifest +
> ['\\end_manifest']
> +
> +        for line in header + [''] + manifest + [''] + self.body:

  I would suggest to include one of the empty lines above in manifest so that 
if we don't have a manifest we don't get two consecutive empty lines (this is 
cosmetics).

> and in lyx_1_6.py:
>
> +def remove_manifest(document):
> +    "Remove the manifest section"
> +    document.menifest = None
>
> + revert =  [
> +           [284, [remove_manifest]],

  I like this. That was what I was thinking. :-)

> Cheers,
> Bo

-- 
José Abílio

Reply via email to