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

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

Re: Change backup system


From: Evans Winner
Subject: Re: Change backup system
Date: Mon, 28 Jul 2008 13:20:21 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Florian Lindner <address@hidden> writes:

    My idea is to copy the file to another folder. When I
    edit and save ~/ text/file.txt the backup is saved in
    ~/.emacs.d/backup/home/florian/ text/file.txt.n with n
    being a number incremted form 1 to x each save.

I have a directory called ~/bu and this in my .emacs
(thought I am not sure which versions of Emacs it works
with):

(setq version-control t)              ; Numbered backups.
(setq backup-directory-alist          ; Backup directory          
      `(("." .                        
         ,(expand-file-name "~/bu"))))

I don't know if this is exactly what you mean....  I
occasionally clean out old stuff from my ~/bu directory.

The files are named like this:

  !home!thorne!hacking!litmus!mla.tmac.~3~

with bang-path kinda names and the number at the end a
version number.

Here is some documentation about those variables:

,----[ C-h v version-control RET ]
| version-control is a variable defined in 
`/home/usr/local/share/emacs/23.0.60/lisp/files.elc'.
| Its value is t
| 
|   This variable is safe as a file local variable if its value
|   satisfies the predicate `(lambda (x) (or (booleanp x) (equal x (quote 
never))))'.
| 
| Documentation:
| Control use of version numbers for backup files.
| When t, make numeric backup versions unconditionally.
| When nil, make them for files that have some already.
| The value `never' means do not make them.
| 
| You can customize this variable.
`----

,----[ C-h v backup-directory-alist RET ]
| backup-directory-alist is a variable defined in 
`/home/usr/local/share/emacs/23.0.60/lisp/files.elc'.
| Its value is 
| (("." . "/home/thorne/bu"))
| 
| 
| Documentation:
| Alist of filename patterns and backup directory names.
| Each element looks like (REGEXP . DIRECTORY).  Backups of files with
| names matching REGEXP will be made in DIRECTORY.  DIRECTORY may be
| relative or absolute.  If it is absolute, so that all matching files
| are backed up into the same directory, the file names in this
| directory will be the full name of the file backed up with all
| directory separators changed to `!' to prevent clashes.  This will not
| work correctly if your filesystem truncates the resulting name.
| 
| For the common case of all backups going into one directory, the alist
| should contain a single element pairing "." with the appropriate
| directory name.
| 
| If this variable is nil, or it fails to match a filename, the backup
| is made in the original file's directory.
| 
| On MS-DOS filesystems without long names this variable is always
| ignored.
| 
| You can customize this variable.
`----


reply via email to

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