help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: backup files and version control


From: Heiko Gerdau
Subject: Re: backup files and version control
Date: Fri, 18 Feb 2005 11:39:38 +0100
User-agent: KMail/1.7.1

Hi,

thanks a lot for your hints. I did as you suggested (changed the name of 
make-backup-file-name) and used your "backup-file-name-p" version. I also 
added my relative backup directories ( "/.backup~" ) to 
backup-directory-alist. Unfortunately all this has no effect.

But while testing I realized the following:

Let's say I have the file "foo.cpp" under version control and it is uptodate. 
If I change that file using Emacs than on saving a new file "foo.bar.~1.4~" 
is written to the same directory, if 1.4 is the current revision in CVS. This 
file has the date of the revision in CVS and is never changed again. I can 
delete it and change foo.cpp again and it's not created again.

So it happens only on the first change of an uptodate file under cvs control. 
Maybe the problem has nothing to with the emacs backup handling.

Any further idea?

Best
Heiko
    
On Thursday 17 February 2005 20:44, Kevin Rodgers wrote:
> Heiko Gerdau wrote:
>  > I need some advice concerning backup files and version control.
>  >
>  > I have written my own elisp function "make-backup-file-name" to
>  > collect backup files in subdirectories named ".backup~". (function is
>  > attached at the end of this mail)
>
> It would be better to write a new function (i.e. with a new name) and
> set the make-backup-file-name-function variable to it (than to redefine
> the make-backup-file-name function).  I also suggest using
> expand-file-name instead of concat to create directory and file names in
> your function.
>
> Using the make-backup-file-name-function variable has the added
> advantage that reading its doc string tells you what else you have to
>
> do:
> | If you define it, you may need to change `backup-file-name-p'
> | and `file-name-sans-versions' too.
>
> So:
>
> (defun backup-file-name-p (file)
>    "Return non-nil if FILE is a backup file name (numeric or not)."
>    (setq file (expand-file-name file))
>    (let ((directory (directory-file-name (file-name-directory file))))
>      (and (equal (file-name-nondirectory directory) ".backup~")
>           (equal (aref file (1- (length file))) ?~))))
>



reply via email to

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