[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Minor bug in simultaneous editing check.

From: Alex Farran
Subject: Re: Minor bug in simultaneous editing check.
Date: Thu, 07 Jun 2001 10:13:43 +0100

Eli Zaretskii wrote:
> > My solution to this is to set the backup-by-copying variable in .emacs.
> Looks like the correct work-around for this case.

It certainly seems to be working.  As I've solved the problem for myself, I'm
mostly interested in working out if Emacs could have handled this unusual
situation better in any way - or if it should even have tried.
> > Surely, though, it would be better if the date check was performed
> > once on the existing file before backing it up and saving the contents of 
> > the
> > buffer.
> I'm not sure I understand what are you suggesting.
> The effect of what NFS does is that Emacs renames foo.bar, and expects
> foo.bar to not exist anymore, but another foo.bar, with a different
> time stamp, magically appears on the disk.  The same kind of thing
> would happen if an external program or another user would produce
> foo.bar between the time Emacs renames it and the time it saves the
> modified buffer.  Any solution to the VMS problem will stop Emacs from
> catching this situation, and so could screw users (by nuking their
> files without warning), I think.

I did consider that but in the usual case, such as another user writing
foo.bar, the chances of it happening in such a short timespan are very small. 
IMO Emacs is being too clever in trying to catch this situation and deal with
it.  Unless date-stamp checking and file writing is an atomic operation (is
it?) there's always going to be a window for files to be changed behind emacs

If Emacs is to deal with files re-appearing after they've been renamed it
would be helpful if it distinguished between this situation and the more usual
case where the date has changed on the original file.  They are very different
situations.  In one I have three files: the backup, the one in the buffer and
the newly created (by NFS in my case) file.  In the other I have just two, the
one in the buffer that I wrote, and the one on disk that some other user
wrote.  What I do next depends a great deal on which of those two situations
I'm in.

       _`\<,                "If you brake, you don't win." -Mario Cipollini
 Alex Farran, Lewes, East Sussex, UK       www.alexfarran.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]