[texworks] external read-access causes TeXWorks to revert open file to old version

Stefan Löffler st.loeffler at gmail.com
Wed Sep 22 16:23:02 CEST 2010


Am 2010-09-22 15:24, schrieb Stefan Müller:
>> This part of your original posting makes me think that it is possibly
>> a caching issue of commits from RAM to your hardrive.
>> " most of the times TeXWorks restores an version of the open file
>> which is older than the saved document"
> You may be right. I can't think how TeXWorks could possibly restore an old 
> version of the  document. Is TeXWorks keeping automatic backups somewhere? 
> (Like Word and OpenOffice do, to restore a file if they crash)

No, Tw shouldn't be keeping backups. However, I don't know the internals
of mercurial. Maybe it synchronizes your working tree somehow when you
commit (if it applies first the old and then the new revision, this
could cause a race condition where Tw detects the first change, loads
the file, and before the file system watcher resumes the second change
occurs; this is just a shot in the very dark, though).

>> Also, there are newer  Windows versions of TexWorks available from
>> Alian Delmot's  here (marked development but quite stable):
>> http://www.leliseron.org/texworks/      You'll notice that the number
>> is v0.3  r606
>> And if you are happy to build it for other OS's, links are here:
>> http://code.google.com/p/texworks/
> I'll try that. Thank you for your help so far.

I forgot to mention: there was no significant fundamental change to that
part of the code since 0.2.3. There were some improvements to maintain
the cursor position and view, but other than that it's pretty much the same.

Anyway, if you build Tw yourself, you could add the following to lines
(linenumber where to add in brackets) to get some debugging information:
[959] qDebug() << "Loading:" << fileName;
[1094] qDebug() << "Changed:" << curFile;
This should print the filenames Tw loads, and whenever it detects a
change to the filename on the harddisk.


More information about the texworks mailing list