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

Stefan Müller warrence.stm at gmx.de
Mon Oct 25 22:36:57 CEST 2010


Another thing I just recognized: In a "positive run" (i.e. where the 
problem occurs) TW prints (beside others) the following debug messages:

Loading: "/dir/to/my/file.tex"
Loading: "/dir/to/my"
...
Loading: "/dir/to/my"
Changed: "/dir/to/my/file.tex"
Loading: "/dir/to/my/file.tex"

Is it correct, that sometimes the directory and sometimes the file is 
loaded?

Stefan


On 25.10.2010 19:19, Stefan Müller wrote:
> Hi,
>
> it has been a while since the last reply, but I was only now able to
> test again on my Linux machine with those debug messages you gave me (I
> didn't compile it for Windows).
>
> So, still strange things that happen. (Sometimes) When I change
> something in the open tex file in TW, save and commit this change with
> TortoiseHG (my Mercurial client), the debug messages say that the open
> tex file has changed and that the same file is loaded (again). Then TW
> displays an older version of the tex file. To get my current file back I
> have to reopen TW.
>
> So there are basically two possiblities I can think of.
> (1) TW has a problem with TortoiseHG accessing the tex file and
> "restores" an old version of the file. What goes wrong? Where does the
> old file come from?
> (2) TortoiseHG messes with the tex file causing TW to reload it. Why
> should TortoiseHG write on the file? And if TortoiseHG temporarily
> writes to the tex file, why doesn't TW reloads again when TortoiseHG
> restores the current (committed) version?
>
> Hopefully someone has an idea what's causing the problem or how it could
> be fixed, especially if it's (1). Thanks in advance.
>
> Best regards,
> Stefan
>
> On 22.09.2010 18:07, Stefan Löffler wrote:
>> Am 2010-09-22 17:49, schrieb Stefan Müller:
>>>> 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.
>>> Maybe that's not clever to ask, but in which file should I put those
>>> lines? I
>>> looked into TWApp.cpp, but it looks wrong there...
>>
>> Oops, sorry. In src/TeXDocument.cpp.
>>
>> Stefan
>


More information about the texworks mailing list