John McCabe-Dansted wrote: > On Thu, Mar 4, 2010 at 6:05 AM, Pavel Sanda <[email protected]> wrote: > > John McCabe-Dansted wrote: > >> Below I present very preliminary support for warning the user when > >> their LyX file is externally modified. Does the following approach > >> sound worthwhile? > > > > this has even some bug number. the reason why its not implementeed > > yet is that its not easy to find a point where to trigger such > > check. for example you definitely dont want it to be checked after > > each typing keystroke inside markdirty. you avoided it, but for the > > price that you'll never check this once editing file started. > > also i would like to have this check on one point not at 10 different > > places... > > Would checking in two or three places (as proposed) seem excessive?
concerning the fact how rarely will be the check in previous patch reached... i mean lets try to find place general enough instead of spilling the code in corner cases. each added place means double the debugging work in case something goes wrong. > >> When the buffer is marked dirty it checks if the file is modified > >> externally. This may avoid the need to merge at all. I suggest that we > >> also: > >> 1) Checks every 1 minute if the file has been modified (Even if a > >> merge is required, the sooner the easier) > > > > that is one possibility. i felt somewhat uncomfortable to have such > > asynchronous events in the code, but now i realized it might be possible > > to attach it to the code for automatical file saves... > > > > secondly it should be possible to turn it off (maybe even by the > > automatical save option?). there are rare but regular reports > > about problems when file are saved over network, and it should > > be possible to avoid automatical saves/polling for such users. > > > >> 2) Checks if the file is modified when the Buffer gains (like kwrite) > > > > dont understand this. > > Sorry, this should have been: > Checks if the file is modified when the Buffer gains *focus* (like kwrite) > > This presumably could be done by listening for Qt "focusChanged" > signals, though I haven't checked how kwrite does this. i see, focus-trigger is a better idea. still i feel bit uncomfortable. in case the network connection disconnects for a while you will freeze lyx until it gets better again? another place coming into my mind will be the code for checking if the buffer can be reverted - its get triggered eg every time you launch file menu. it already touches the active buffer so no additional harm. sorry to be so picky about this, but i clearly remember the frustration i had with ms exploder when he tried to poll network places around every second (nonrelated) action i did with him. normally you dont recognize, but if the net by accident goes down or have lags... or we need at least some setting to turn it off. > >> Finally, I was thinking that when the file is under version control > >> LyX could poll the version control about every half hour to see if > >> there is a remote update. This should be subject to various > > > > how do you imagine such svn poll technically? > > Well, for example, when I start LyX I run (attached) > svn-up-to-date.sh & > Polling the server every 30 minutes could reduce further the > possibility that a merge is needed. you mean this really works for you? to my knowledge svn info touches only the local checkout not the archive on server. pavel
