Bo Peng wrote:
You uncompress to LyX's temporary directory. So you now have:
  /tmp/lyx_randomstuff/filename.lyx
  /tmp/lyx_randomstuff/filename.lyxdir/
Then LyX opens the former.

Isn't this exactly how compressed files work now?

Sorry, this is still unclear to me.

In your approach, when you turn on the bundled mode, your
filename.lyxdir is created under the document directory, right? When
you insert a file, you copy the file to
$DOC_DIR/filename.lyxdir/figures/whatever...

Now, you open a compressed file and the directory is now under
$TEMP_DIR. Is this file in bundled mode? When you insert another file,
will the file be copied to $TEMP_DIR/filename.lyxdir or
$DOC_DIR/filename.lyxdir?

It depends upon whether the file is bundled or also wrapped. If the file is just bundled, then there's just $DOC_DIR/filename.lyxdir.

If the file is wrapped, that directory need not exist at all. Rather, when you open the wrapped LyX file, it is, as I said, decompressed in the temporary directory, and then LyX treats that temporary file just as it treats any other file. So when you add a file, it gets copied to $TEMP_DIR/filename.lyxdir and then wrapped up when the file is saved. As I said, this is conceptually exactly how LyX works now with compressed files. The only difference is that the bundle directory is decompressed and compressed along with the LyX file itself.

So you could have filename.lyx, filename.lyxdir/, and filename.lyz all in the same directory, and operations on one wouldn't affect the other. I wouldn't recommend this, though.

Richard

Reply via email to