On 10/10/2013 05:41 PM, Georg Baum wrote:
Enrico Forestieri wrote:
On Wed, Oct 09, 2013 at 10:22:20PM +0200, Georg Baum wrote:
Enrico Forestieri wrote:
The other difference I noticed is that on Cygwin and Solaris I get
\renewcommand instead of \newcommand. That is, applying your patch,
on Debian exporting from the GUI or from command line, produces the
same result, but lyx segafaults on exit.
On Cygwin and Solaris, exporting from the GUI changes \newcommand
into \renewcommand, but lyx quits normally.
The joy of multithreading, I suppose.
I am not sure. I would think that this is something else. I do not see
this, but if I use the Czech GUI I see that \shortcut{undefined} is
translated if exported from the GUI, and untranslated if exported from
the command line. This should not happen.
This behavior is unchanged. It's still a mystery.
OK, I believe I understand what happens, but I can't test, since I do not
see the \newcommand differences: The MacroData which is constructed from a
DocIterator is a lazy version, which does not have data initially, but
queries it when needed. This is not bad per se, but implemented in a hacky
way through all these mutable members. Unfortunately this implementation is
incomplete, since an updateData() is missing in redefinition() and type().
Therefore, it could happen that a redefinition() call in the command line
export does not return the correct data, but the same call in the GUI export
returns the correct data, since any other member is queried by the GUI. The
updateData() calls in requires() are not needed, since this member is not
filled in updateData().
Does this patch fix the problem for you?
I can't test either, as I've not noticed the problem. But great work again.
Just a question: Is there any reason not just to use the lazy version
everywhere? The only place the non-lazy constructor is used is in
MacroTable::insert. We don't have a DocIterator there, but perhaps
we could pass one from upstream?
Richard
Georg