Since it was somehow hidden I post here again what I wrote in the "Latest 
changes in manuals" thread:

I was now able to reproduce the changed paths. According to 
http://www.lyx.org/trac/ticket/9815 this works as designed: If a document 
contains a valid \origin tag, then all relative paths are changed to 
absolute ones constructed from \origin on saving.

This is in general the wanted behaviour (and the reason for having \origin 
at all), except for one case: Editing LyX documentation in a directory 
which 
is not the system dirctory as determined by the Package class in 
src/support. In this case, the \origin machinery assumes that the user did 
copy the doc to some other location, and that he wants to keep it separate 
from the LyX installation. This assumption is wrong if one edits the docs 
in 
the source tree, and I agree that something needs to be done for this case.

Unfortunately I am not sure what to do. Here are the alternatives I can 
imagine:

- Set \origin to unavailable for all docs in the sources. This would be 
easy 
to do, but also mean that we need to change it during installation (which 
is 
currently only implemented for autotools, not in cmake and not in the 
windows installer)

- Implement some heuristic to recognize if docs in a LyX in lib/doc 
directory of a source tree are edited, and do not change paths if that is 
the case. Not very transparent for the user, and strange things can happen 
if the heuristic is wrong.

- Do not change the paths in general if the files can be found using the 
relative paths. Has the additional benefit that this is also the wanted 
behaviour if I copy a whole directory of LyX files (including referenced 
graphics) to a new location. Disadvantage would be that the machinery does 
now depend on the presence of external files, and it is not guaranteed that 
the file that is found is the correct one.

Are there other possible solutions? I prefer the last one, since it does 
not 
get into the way of people who know what they are doing and copy a LyX file 
including all needed dependencies. The current solution punishes these 
people by requiring them to repair the incorrectly changed paths by hand, 
or 
by forcing them to disallow setting \origin in the preferences (but the 
latter does not work if you receive files from collaborators which have 
\origin set).

Uwe and Kornel voted for the last option as well. I'll see if this can be 
implemented easily.

Georg


Reply via email to