rgheck wrote:
Bo Peng wrote:
Hi, Richard,
I think most of your problems can be solved in a less-radical way, by
saving relative path, or something like that, so that you can recover
user input.
The attached patch tries to do exactly this. It adds meta_ to
EmbeddedFile and allow InsetBibtex to add 'biblio' to an EmbeddedFile.
params are created from this meta info so minimal changes are needed
to the current code base.
Latex output etc does not work yet due to my lack of time, but with
this meta_ information, I am sure you can quickly figure them out.
I hate to be a pain the ... about this, but I am morally certain that
this will not work, at least in the long term. The problem isn't just
the lack of meta-info. It's the fact that this way of doing things is
completely contrary to how the InsetCommand hierarchy is supposed to
work. (I recently re-wrote the whole InsetCommandParams implementation,
so I've spent a lot of time with it.) You've got two parallel
representations of the parameters, one in the EmbeddedFileList and one
in the InsetCommandParams, and there is simply no way to guarantee that
they are synchronized and therefore that you don't over-write
information that was committed to one of them from elsewhere. For
example, you can do this:
setParam("bibfiles", bibfilelist);
but then what happens with the metaInfo? Nothing. Or you can do this:
setParams(p); // InsetCommandParams(p)
and again we're out of sync. You can override those methods, I suppose,
but then I can do this:
p_["bibfiles"] = bibfilelist;
The problems I originally encountered were precisely in this area. Of
course, if one were extremely careful not to use the methods of setting
parameters, etc, that the InsetCommand infrastructure provides, then we
won't have these problems. But surely we will have these problems,
because all of that is so natural to do.
This doesn't mean you can't have the EmbeddedFile objects in the insets.
You can if you like. But what you cannot do is use them to represent the
parameter information. It would be trivial to add this sort of thing to
my patch: Give InsetBibtex an EmbeddedFileList, and then, whenever it is
needed, update it with information from the InsetCommandParams. But the
only difference between this approach and mine is that I don't keep this
list around but construct it from scratch when it's needed.
If you want my 2 euro cents Having read superficially this thread, I
think Richard has a point here. I don't think the performance penalty
will be sensible going this way...
Abdel.