unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* backups of VC files and vc-make-backup-files
@ 2002-07-24 13:41 Pavel Hlavnicka
  0 siblings, 0 replies; only message in thread
From: Pavel Hlavnicka @ 2002-07-24 13:41 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-07-24 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-24 13:41 backups of VC files and vc-make-backup-files Pavel Hlavnicka

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).