On 07/31/2017 08:31 AM, Helge Hafting wrote: > > > Den 27. juli 2017 19:48, skrev Richard Heck: >> On 07/27/2017 11:52 AM, Roberto wrote: >>> Hi Richard, thanks for bringing in your experience. >>> >>> If the tar.gz was something you can "mount" like a read-write DMG it >>> would make sense to say that the archive does what I have in mind. As >>> far as I know one can open DMG files and edit them and close them, >>> effectively saving the content. The way it is now with tar.gz for me >>> it is good only for archival purposes. >> In theory, this could probably be done using fusefs on Linux, but that's >> not a general solution, and we don't automatically add images, say, to >> the archive when you add a picture. > > Isn't fusefs overkill?
Yes, I was suggesting it only as a temporary solution. > LyX does its work in a temp folder anyway. > > To support working with a single file containing a folder with > file.lyx and several figures, just have LyX unpack that archive to the > temp folder. Let the user edit the document. Since all the graphichs > are unpacked too, they can be edited with their appropriate external > editors if needed. When the author saves, LyX recreates the archive > file and overwrites the original. (LyX knows this is a all-in-one > document, because it was opened as such.) When LyX is closed, the temp > directory goes away as usual. > > This should give us: > * Backward compatibility. > - Those preferring figures as separate files see no change. > - Existing documents works as always > > * Those wanting an archive can "save as archive" (not export, but save). > - Then they get an archive containing the document and all included > stuff. (graphics, subdocuments, external insets). The original > graphics files etc. must be kept - they may be in use for other > purposes too. But no longer in use by the now archived document - it > has its own copies of everything. > - To reverse the process, someone who opened an archive may use > "File->convert to separate files". This replaces the archive file with > the folder containing separate files. This is precisely what I had in mind. > Seems that this approach would fulfil Roberts wish for > user-friendliness, without ruining things for the single-files crowd. > LyX could mostly work "as usual", with the archiving code mostly > dealing with "open" and "save". And of course, every graphic the user > adds to a document while in archive mode. > > There is the question of what to do about inclusion of a graphic that > exist higher up in the directory tree. I believe the user-friendly way > would be to copy such things into the archive folder - possibly in a > subfolder. Enrico's LyX archiver already solves this problem...somehow. It doesn't matter a tremendous amount how, since the user won't actually see the structure here, unless they manually unpack it. Richard