Newbie Emacs tip: As you install more Emacs packages, you'll probably eventually install CEDET, such as for Speedbar. One of the features of the CEDET tools indexes many kinds of files you edit, and saves those indexes as semantic.cache files. By default, it puts those cache files right alongside your source files, which is annoying, especially when editing files in directories that get pushed to web servers. Thankfully, you can tell it to put those files somewhere else:
(setq semanticdb-default-save-directory “~/.emacs.semantic.cacheâ€)
Emacs does this with back-up files as well (myfile.cpp~), which I also find annoying, and these can also be moved:
(setq backup-directory-alist '(("." . "/home/dsanders/.emacs-backups")))
See the manual for more on backup files.
I like to leave auto-recover files (#myfile.cpp#) where they are, because I want them to get my attention. I don't know if there is a way to move them. Anyone?