Found some very useful emacs info in this this blog post.

Put the following into your config and your temporary and autosave files will not clutter up your project directory.