Installing Emacs on Debian wheezy

Debian 7 code named wheezy comes bundled with Emacs version 23. I want to use the latest and greatest Emacs 24.3 = ) So, without any other words, I present to you the complete guide of how to install Emacs 24.3.1 on Debian 7 wheezy.

1
2
3
4
5
6
7
8
9
10
11
12
sudo aptitude install git-core libxaw7-dev libxpm-dev libpng12-dev\
  libtiff5-dev libgif-dev libjpeg8-dev libgtk2.0-dev libncurses5-dev\
  autoconf automake texinfo
sudo apt-get build-dep emacs
git clone git://git.savannah.gnu.org/emacs.git
cd emacs/
git checkout emacs-24.3
git checkout -b custom_branch
./autogen.sh
./configure --prefix=/opt/emacs24
make --jobs=2
sudo make install

The above steps will install Emacs to /opt/emacs24. To run Emacs, you can launch it by:

1
/opt/emacs24/bin/emacs

It is important to add the directory, where Emacs binary is found, to the system PATH variable. The directory contains several other important Emacs related binaries:

Place the following line at the bottom of your ~/.bashrc file:

1
export PATH=$PATH:/opt/emacs24/bin

Now you can run Emacs with a simple command:

1
emacs