Well, let us start from the beginning. Hopefully at a level of design. :-) But I first would like to point out that designs dictate implementations. If I do not introduce a bundled mode, I can not use a zip format. I can not switch a file to binary format just because I insert an embedded inset. Anyway, let us assume that they are details.
My design is motivated from a very simple concept: allow a file to be embedded. An embedded file is anonymous. LyX kindly keeps a link between an embedded file and its external version, and provides features such as update from external. But for the most part, an embedded file is anonymous, just like how they are in applications such as OO and word. This is all users have to know. As simple as that. A user noticed that a new checkbox was added to the graphics dialog of lyx 1.x.x. If he checked that, closed the dialog and opened the dialog again, the filename became *****. When he changed the external file, the lyx output was not updated. This was easy to understand so there was no surprise. He then right clicked the inset and happily found an un-embed menu. He clicked it and things went back to normal. His small adventure ended without surprise. (Note that un-embed is likely to be enabled when the external file exists, and is identical to the embedded file. It is an undo feature.) He could find some creative ways to use this feature. He may want to embed fixed files (such as a logo) and keep other more frequently updated files external. Having less files on disk and on his svn repository could be a small treat for him, but they were just peanuts. He continued to edit his theis using mostly external files because many of them were generated by computer scripts. He occasionally edited his .lyx file directly and nothing exciting happened there either. One day he needed to send his document to a co-author who did not have access to his subversion server. He thought that embedding all external files was a better idea than manually zip all external files. He was happy to find Document->Embedded Files->Embed all, and clicked it. All related insets appeared to be embedded and his document could be compiled without any external file. He then sent this file to his co-author, who could open it directly by lyx. The co-author edited the document here and there. He inserted and replaced a few more figures, embeded them and sent the document back. Our user checked the document, accepted most of the changes and did more edition. He did not notice that the files are embedded until he tried to save the changes to his subversion repository. Because the paper was more or less done, he decided to just submit this version and remove the external files. He did so and got a less clustered repository. Later he found out that a file needed to be updated, he un-embeded that particular file so that he could update it. He knew he also had the option to 'update from external' but it was just easier to use an external file. He later knew that there was another option, "File->Export->LyX with extracted files" that could extract all embedded files, but he did not really care. Before he graduated, he decided to make his customized layout file available to others. He made a copy of his thesis, removed the content but kept the university class and layout files, and posted it to a shared place. He received some thank-you cards from fellow students who could simply open that file, fill in there content. Life was easy. The key point here is that there is no surprise, and everything happens naturally. This is a good sign. Now, let me tell you why I dislike your idea. It is weird to have a document to be a file + a directory. This is unheard-of and is unnatural. All computer users have this notion of a document being a file, possibly with some links to external files (html or latex with external file). I do not know what other word I can use to describe your 'document', it is simply unnatural. You can argue that this filename.lyxdir directory is external to filename.lyx, nothing has changed. No, my external files are files that are created by me, generated by my script. I know what their names are because I named them. I created a directory structure for them so that I know where to find figure 2 of chapter 4. They are my external files, not filename.lyxdir/figures/figure2_copy_3.png. Now, as a normal user, I installed a new version of lyx. I started lyx to edit a file. I found a new option 'turn to bundled mode' and clicked it. Suddenly, all my insets are changed to some weird names such as filename.lyxdir/figures/figure2_copy_3.png. This was scary. I turned off this 'bundled mode', but my file was still doomed. I sent an email to lyx-users and I was told that there was something in File->Export -> LyX with external files. I used it, close lyx, find a new directory filename.extracted with my files. I copied the lyx file back, and phew, what the hell was this? Then I learned that that was a way to bundle external files. Wait, I saw this filename.lyxdir directory but how exactly I was supposed to bundle it? Uwe from lyx-user kindly told me that I needed to turn on compression, but when I clicked it, nothing happened. I still had this filename.lyx and filename.lyxdir. It took me a while to find that filename.lyx is now a binary file, actually a zip file, with the original filename.lyx and filename.lyxdir, and I could send this file to my co-author. (NOTE: currently, compressed .lyx file still has .lyx suffix). The file was sent back from my co-author and I was having a hard time deciding what to do with my repository. Because the paper was more or less done, and because File->Export->LyX with external files was not particularly easy to use, I removed my original external files. Although I hated the weirdly named files under this filename.lyxdir directory, I put them to the repository anyway. I then found that I needed to update a computer generated file but my script only produced chapter2/figure_4.png. It only took a few 'update from external file' to bore me. Fortunately, I found from the corresponding inset that this file is now called filename.lyxdir/figures/figure_4_copy3.png. I changed my script and felt like a hero. Then I sadly noticed that I had a repository with weirdly named files, and a script that produced some weirdly named figure. In short, Richard, I dislike this filename.lyxdir in my document directory, I do not want to see these long weird filename.lyxdir/figures/blah names in my graphics dialog. I hate lyx for moving my files around and semi-force me to use an ugly directory structure. All those things are unnatural. This may be only me, but this is my true feeling about your approach. Cheers, Bo
