[Top][All Lists]

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

Minor bug in simultaneous editing check.

From: Alex Farran
Subject: Minor bug in simultaneous editing check.
Date: Wed, 06 Jun 2001 15:25:56 +0100

I am running emacs on linux to edit files over an NFS link on VMS.  This setup
has caused the auto-backup, simultaneous editing check, and VMS version
numbers to interact in an interesting way.

Say I have a file on VMS called foo.bar.  There are multiple versions -
foo.bar;1 , foo.bar;2, foo.bar;3.  Where foo.bar;3 is the latest version.

Over NFS these appear as foo.bar.1, foo.bar.2 and foo.bar for the latest

When I edit foo.bar on emacs and go to save it this happens

1.  To create a backup, the latest version of foo.bar ( the only version as
far as emacs is concerned ) is renamed as foo.bar~
2.  The latest foo.bar is is now version 2, so foo.bar.2 is now foo.bar.
3.  Before saving, emacs checks the modification date of the foo.bar file on
the disk which, because it is version 2 and version 3 was opened to begin
with, won't match it.

4.  I can now either 
    a. Ignore the warning and save foo.bar anyway - assuming no-one else was
editing the file at the time the vax user will lose version 2 because it has
been overwritten, and version 3 will only survive in the emacs backup file. 
Next time version 1 will be overwritten, and after that there will be nothing
left to overwrite so the warning won't be made.

    b. Don't save foo.bar and assume that this leaves everything as it was. 
But of course it doesn't.  Version three has been renamed.  The next time
anyone goes to edit foo.bar they will get the previous version, and if they
are using emacs the backup of version 3 will be overwritten by the backup of
version 2, and then version 1.  Only when just the very oldest version is left
will I be permitted to modify it, but in the process all previous
modifications will have been lost.

My solution to this is to set the backup-by-copying variable in .emacs.  That
way the version I'm checking against is the version I opened in the first
place.  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

       _`\<,                "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]