Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!cornell!rochester!bbn!jr@bbn.com From: jr@bbn.com (John Robinson) Newsgroups: comp.emacs Subject: Re: how to change backup file names? Message-ID: <34831@bbn.COM> Date: 19 Jan 89 22:09:29 GMT References: <2926@uvacs.cs.Virginia.EDU> <8776@megaron.arizona.edu> <47991@yale-celray.yale.UUCP> Sender: news@bbn.COM Reply-To: jr@bbn.com (John Robinson) Organization: BBN Systems and Technologies Corporation, Cambridge MA Lines: 44 In-reply-to: Ram-Ashwin@cs.yale.edu (Ashwin Ram) In article <47991@yale-celray.yale.UUCP>, Ram-Ashwin@cs (Ashwin Ram) writes: >Hmmm... an 'apropos' on 'backup' reveals: > > find-backup-file-name: > >and: > > make-backup-file-name: > >Why are there two functions? Does one call the other? Which is the right >one to redefine for customization? A find-emacs-tag on one of these gets you to files.el, which has: (defun make-backup-file-name (file) "Create the non-numeric backup file name for FILE. This is a separate function so you can redefine it for customization." (concat file "~")) ;[... other defun deleted] (defun find-backup-file-name (fn) "Find a file name for a backup file, and suggestions for deletions. Value is a list whose car is the name for the backup file and whose cdr is a list of old versions to consider deleting now." (if (eq version-control 'never) (list (make-backup-file-name fn)) (let* ((base-versions (concat (file-name-nondirectory fn) ".~")) (bv-length (length base-versions)) ;... So the former (of Ashwin's list) calls the latter. Redefining the former is sufficient, unless you want to change the way version-controlled backups look. Version-control creates file versions using backups of the form foo.~1~, foo.~2~, etc. foo~ is linked to the most recent backup. More in the manual. I think version-control will someday be part of GNU (the operating system), so changing the form of these files if you use them may be a little more serious departure from common practice. -- /jr jr@bbn.com or bbn!jr