backup files from editor

Grünewald Michaël michaelgrunewald at
Thu Mar 5 03:44:41 PST 2009

Hi prad,

Le 5 mars 09 à 09:15, prad a écrit :

> editors can produce backup files - eg emacs adds a ~ to the backup
> file. the backup file keeps getting changed as you make changes to the
> original so you i'm wondering what the point of them is.

Please refer to the Emacs manual (info m Emacs) to learn about the  
precise rule governing backup files. Just like you, I do not like to  
have all of these backup files springing off everywhere in my  
filesystem. Instead of turning backup off, I tell emacs to put them in
the `.emacs.d/backup' I created for this purpose:

(setq backup-directory-alist '((".*" . "~/.emacs.d/backup")))

You can get a finer control on backup location, read documentation for  
the bariable `backup-directory-alist' to discover how.

Note that this setup tends to produce super long file named in  
`~/.emacs.d/backup' which may break some fragile systems (e.g. I  
encountered problems when preparing ISO filesystems not supporting  
these long names).

> i turn off backups (so my directory doesn't fill up with ~ files), but
> then i also don't space things properly and occasionally use cryptic
> names when programming (from what my son tells me), so i figure i  
> should change some of these bad habits.
> how do people make use of the backup feature when they program?

Note that basic functionalities of RCS systems are well integrated in  
Emacs (see the Tools menu), and I systematically use SVN (in the  
ports) as a sophisticated backup system when I edit files that count.

Note that the FreeBSD wiki features an intereting comparison of the  
various RCS systems available, so if you are interested with this  
approach, you can look for this comparison and make your choice.

You can also use RCS without the (moderate) hassle to set up a  
repository, Emacs has support for an `immediate' RCS system, doubling  
the files you want to keep track of with a `,v' companion file,  
containing revision history. (IIRC, this RCS system is the ancestor of  
CVS, but I cannot find again the name, sorry about this.)
All the best,

More information about the freebsd-questions mailing list