I had Esc key set as the meta key in Emacs and wanted to change it to have alt key as my meta key. It was done by putting this command to the end of my ~/.emacs file:
(setq x-alt-keysym 'meta)
It wasn't straightforward to find this answer, so this is why I put it on my blog. Enjoy!