Jürgen Spitzmüller wrote:
RGH wrote:
Whether you want to go that far in 1.5.x, I don't know. The problem, of
course, would be that people who had been using local layouts would
effectively lose them when they opened their files. But we could still
look for the local file and, if we found it, pop up a special message
refusing to open the file and telling them to move the file to their
user directory and reconfigure. We could even do that for them. This is
not good, but dataloss is not good, either.
I'm uncertain what to do in trunk.
BTW, here's another sort of problem. Suppose you have a "local" version
of a system layout you are using with the given file. The way things now
work, LyX will prefer the local version. Now suppose you copy a file
that you don't intend to use with a local layout file into that
directory and suppose further that this file happens to use the system
layout with the same name. Now LyX will prefer the local file, again.
Note that this could get especially messy if you were opening things
from your email reader, and things were all being unpacked into a
temporary directory. You open something with a localized version of
article, and suddenly everything you read from your email reader wants
to use it.
For 1.5. I fear we cannot do much. We cannot remove the feature AFAICS, since
this is a file format change.
Not strictly speaking. There's nothing in the file format per se that
would change. Local layout files are not identified by complete paths or
anything like that, and there's no special "\local_layout" flag. The way
this works is simply that, when LyX sees "\textclass article", it first
looks in the document directory for article.layout and, if it finds it,
it uses it; otherwise, it checks the system list and uses what it finds
there. Removing the feature is just removing the first check.
But yes, this is a change in the semantics, and maybe that counts as a
format change, even if the syntax of the file is unchanged.
We can try to indeed copy the layout file, or
simply popup a warning if a user with a local layout performs
LFUN_BUFFER_SAVE_AS. Both is not nice, but probably better than the current
solution.
This helps, but it isn't sufficiently general, since the file could be
moved or copied for various reasons not under our control.
Let's see if anyone else has any ideas. Anyone?
rh