Tommaso Cucinotta schreef:
rgheck wrote:
I just tried, and we have segfault after 3) (infinite recursion in Buffer::masterBuffer() [1]). Probably such operation attempt should give up with an error to the user (but it may not be easy to identify an arbitrary "loop" in what is supposed to be a DAG, with documents that are not necessarily open).

There's an attempt to deal with this kind of problem in other places, such as InsetInclude. Apparently, it pops up here, too.
Probably the parent() relationship should not be allowed to have loops anyway. One possible way to deal with it may be to just check for loops every time a new child->parent relationship is created, and forbid its creation in case it creates a loop, perhaps with a warning message to the user saying that he/she has to manually break the chain of inclusions (and mention the document file names), otherwise LyX may not work properly.

Yes, that will be helping a lot (actually I was already starting to do that, see also r32378). It fixes also a problematic bug in branch (#6251), and the recursive include you mention.

it seems the master changes according to the last-loaded master. Also, when closing one of the two masters, its child is also closed.
This is expected, basically, at least the first part. That the child closes whichever master closes is wrong.
Here I'm not understanding: why are children closed when their master is closed ? Suppose I'm working on a.lyx and b.lyx, with a including b. After a while, I decide only b needs further changes, then I save and close a, but also b is closed -- this puzzles me a bit.


I guess the rationale is that we open all children automatically too. So, if you're working on a multi-part document, you'd only have to open the master to have all children, but then it's convenient that if you close the master you'll also close all children.

So, if you can think of an intuitive way of handling this.. let us know. Maybe, we should only close the hidden children (the ones that were not explicitly opened by the user). Maybe, we should ask the user whether he wants to close all children (and have a 'do not ask again' checkbox). Maybe, we should have two options for closing a master buffer e.g., Close Master and Close Family.
   T.

Vincent

Reply via email to