Emacs cmd-key on Mac

Emacs on my Macbook Pro uses the “alt” key (the one to the left of the “cmd” key) to be the Alt (meta) key when doing things like Alt-Backspace to delete backwards by word. This is quite annoying for me as I naturally try and use the command key for this. To fix this put the following in your .emacs file.

(setq mac-command-modifier 'meta)