From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Heiko Gerdau Newsgroups: gmane.emacs.help Subject: Re: backup files and version control Date: Fri, 18 Feb 2005 11:39:38 +0100 Message-ID: <200502181139.38976.hg@technosis.de> References: <37kah1F5cahslU1@individual.net> Reply-To: hg@technosis.de NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1108728158 29811 80.91.229.2 (18 Feb 2005 12:02:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 18 Feb 2005 12:02:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 18 13:02:38 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D26oV-00029N-RN for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Feb 2005 13:00:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D274q-0005AJ-1e for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Feb 2005 07:17:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D25rK-00071C-Fz for help-gnu-emacs@gnu.org; Fri, 18 Feb 2005 05:59:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D25rF-00070g-6Y for help-gnu-emacs@gnu.org; Fri, 18 Feb 2005 05:59:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D25oz-0006f0-3x for help-gnu-emacs@gnu.org; Fri, 18 Feb 2005 05:57:18 -0500 Original-Received: from [80.237.130.29] (helo=server021.webpack.hosteurope.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1D25Xz-0008VT-4V for help-gnu-emacs@gnu.org; Fri, 18 Feb 2005 05:39:43 -0500 Original-Received: by server021.webpack.hosteurope.de running Exim 4.34 using asmtp from p549042e0.dip.t-dialin.net ([84.144.66.224] helo=ataq-hg.technosis) id 1D25Xw-000476-Bz; Fri, 18 Feb 2005 11:39:40 +0100 Original-To: help-gnu-emacs@gnu.org User-Agent: KMail/1.7.1 In-Reply-To: <37kah1F5cahslU1@individual.net> Content-Disposition: inline X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.help:24159 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24159 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))) ?~)))) >