One thing that really bugs me about Emacs is the way it clutters up my directories with backup files (filenames ending in ~) and autosave files (filenames starting with #). Fortunately there's an easy way to move them elsewhere. Unfortunately the technique isn't consistent across Emacs versions. In GNU Emacs 21, you can set backup-directory-alist and auto-save-file-name-transforms. In XEmacs 21, you can set bkup-backup-directory-info and auto-save-directory. Here's what I do in GNU Emacs:

Be advised that for Debian-based systems (including ubuntu), the default is to clean out /tmp on every boot; so storing your autosave backup files there might not be a good idea. (Autosave especially, as you normally need them exactly when you've rebooted unexpectedly!) So users of those systems may want to set user-temporary-file-directory to something more permanent, thus:

Thanks! I was using the function "make-backup-file-name" for my backup, but for some unknow reasons this function doesn't work anymore on my new computer.

Anonymous
wrote at
Friday, October 1, 2010 at 12:10:00 AM PDT

I am running emacs 23.1 on Windows, accessing files on a network (Linux) drive. This method seems to not work for files on the network drive (L:\), but works fine for files on the local harddrive (C:\) ??

Hi Anonymous — yes, there are all sorts of weird things that happen with network drives, unfortunately. It's not just Emacs; it's that network drive protocols don't always support the full set of file operations. I'm afraid I don't have any suggestions for you :(