On Thu, Aug 30, 2007 at 01:57:52AM -0400, Richard Heck wrote: > Enrico Forestieri wrote: > > On Wed, Aug 29, 2007 at 12:02:24PM -0400, Bennett Helm wrote: > > > > > >> Start with an existing file and open in in LyX. Modify it (in LyX), > >> and save it. The dialog pops up indicating that the file has been > >> externally modified, asking whether you want to save anyway. > >> Subsequent attempts to save the file work fine; it's only the first > >> one that provide the false warning, and it does so every time. > >> > >> I'm guessing the problem is that Macs save information not only about > >> creation and modification dates for files, but *also* for last opened > >> date. So when you open a file, Mac OS then makes a change to the file > >> (updating the last opened date), which LyX detects as an external > >> modification. I don't know how to confirm this guess, however. > >> > > This is not a Mac problem, it is a genuine bug occurring when loading > > a .lyx file having a previous format. The checksum and timestamp of the > > converted (rather than original) file were being saved. > > The attached patch solves the issue. > > > Yes, I saw this on Linux, too. Comment below. > > rh > > > > ------------------------------------------------------------------------ > > > > Index: src/Buffer.cpp > > =================================================================== > > --- src/Buffer.cpp (revisione 19907) > > +++ src/Buffer.cpp (copia locale) > > @@ -704,6 +704,12 @@ > > int const file_format = convert<int>(tmp_format); > > //lyxerr << "format: " << file_format << endl; > > > > + // save the timestamp and checksum of disk file > > + if (!pimpl_->checksum_) { > > > I take it that the point of the preceding line is that we may go back > through this again, when read(tmpfile) is called later, and then we > don't want to reset the timestamp, etc. If so, a comment would help.
I added a comment and committed the fix. -- Enrico