From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Pavel Hlavnicka Newsgroups: gmane.emacs.bugs Subject: backups of VC files and vc-make-backup-files Date: Wed, 24 Jul 2002 15:41:40 +0200 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <3D3EAE94.7030805@gingerall.cz> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1027518136 9751 127.0.0.1 (24 Jul 2002 13:42:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 24 Jul 2002 13:42:16 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17XMP9-0002X9-00 for ; Wed, 24 Jul 2002 15:42:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17XMPP-0005XJ-00; Wed, 24 Jul 2002 09:42:31 -0400 Original-Received: from termit.gingerall.cz ([212.24.153.2]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17XMNz-0005WD-00 for ; Wed, 24 Jul 2002 09:41:03 -0400 Original-Received: from gingerall.cz (IDENT:hIG8GXOamQlKEgFU8VBPQtFJL4q+3ird@angrest.gingerall.cz [212.24.153.10]) by termit.gingerall.cz (8.11.2/8.11.6) with ESMTP id g6ODew215104 for ; Wed, 24 Jul 2002 15:40:59 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020605 X-Accept-Language: en, cs Original-To: bug-gnu-emacs@gnu.org X-Enigmail-Version: 0.61.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:2871 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:2871 In GNU Emacs 21.2.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d scroll bars) of 2002-04-09 on porky.devel.redhat.com configured using `configure i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --with-gcc --with-pop --with-sound' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US locale-coding-system: iso-latin-1 default-enable-multibyte-characters: t The backup of version controlled files is created even if vc-make-backup-files is set to nil. While the vc-find-file-hook hook is executed (in vc-hooks.el), the vc-make-backup-files variable is checked and the backup-inhibited local variable is set correctly, what prevents emacs to create an ordinary backup files. What seem to be a problem is a fact, that the vc-make-backup-files is not tested while the file is saved. The vc-before-save is called w/o any check, and there is no check in this function too. I fixed this problem locally modifying the vc-before-save as follows: (defun vc-before-save () "Function to be called by `basic-save-buffer' (in files.el)." ;; If the file on disk is still in sync with the repository, ;; and version backups should be made, copy the file to ;; another name. This enables local diffs and local reverting. (let ((file (buffer-file-name))) ;;_ph_ vc-make-backup-files was not checked (and vc-make-backup-files ; <==== HERE (vc-backend file) (vc-up-to-date-p file) (eq (vc-checkout-model file) 'implicit) (vc-call make-version-backups-p file) (vc-make-version-backup file)))) I don't know, whether it matches the concept, but it works :) Emacs rules! Have a nice day Pavel -- Pavel Hlavnicka Ginger Alliance www.gingerall.com