Emacs - create dirs when creating files

A handy function pulled from http://www.reddit.com/r/emacs