First off, you should download the Emacs 24.4 source tarball:
cd ~
mkdir emacs-src && cd emacs-src
wget http://mirror.team-cymru.org/gnu/emacs/emacs-24.4.tar.gz
tar xvf emacs-24.4.tar.gz
Now, you want to compile the Emacs binary.
sudo apt-get install build-essential
sudo apt-get build-dep emacs24
cd emacs-24.4
./configure
make
sudo make install
type "emacs-24.4" to execute the Emacs
open /etc/bash.bashrc
add alias emacs='emacs-24.4'