In this tutorial I will show you how to install the Emacs-snapshot at your Debian. Emacs-snapshot is a cool package built and deployed by Romain Francoise, a long time GNU and Debian developer. Romain is doing a great job packaging emacs from CVS for those interesting in run a really fresh emacs (with the last feature), even more fresh then the packages at Debian official repository. Due to the fact that Emacs is one of the most old editor still in development, install a CVS snapshot doesn’t means “install unstable and with bugs” version. In my tests here the package works smoothly without giving me any problem, but remember: Install it is up to you
This post is dedicate to my good friend Dirceu, that recently instigate me to give Emacs a try. It is not easy for a long time vim user like me to effectively be converted to Emacs, but at least I’m trying…
Introducing and Installing the Package
A description From emacs-snapshot site says:
emacs-snapshot is a set of packages of the CVS version of GNU Emacs for the Debian operating system. It is updated regularly from the CVS trunk. Two flavors are available: a GTK version (emacs-snapshot) and a console-only version (emacs-snapshot-nox).
The recommended version for desktop users is emacs-snapshot. For servers, emacs-snapshot-nox is usually a better choice since it has minimal dependencies.
It means you need to do a choice between terminal or desktop, right? yes and no. In my opinion the best way to use Emacs is at terminal, but I recommend you to install both and just after the installation you do a real choice. In Debian it is easy to set which alternative version you’d like to run using the command update-alternatives. I’ll explain this later… for now let’s focus on add the emacs-snapshot repository.
For now on, you should use sudo or run all the commands below as root. Open up a terminal and run the command:
$ nano /etc/apt/source.list
Now lets add the repository line. If you are running Debian Testing or Unstable like me, you will add the line below and save the file (For Debian Stable, use lenny instead of sid):
deb http://emacs.orebokech.com sid main deb-src http://emacs.orebokech.com sid main
Good, we have the repository. Now lets get the Romain’s GPG key. You need to teach your Debian box to add that gpg key in the trusted repositories keyring. Use the commands below for your convenience (adding the key and refreshing the repository list):
$ wget -q http://orebokech.com/Romain_Francoise.pgp -O- | apt-key add - $ aptitude update
Good, we are OK to install the package. Go ahead and get the packages:
$ aptitude install emacs-snapshot emacs-snapshot-nox
Done, we accomplish the installation process. By default, when you type emacs at the terminal, the GTK version will open up. Alternatively you can use the No X version (terminal version). Completing the next steps to change it.
Using update-alternatives
The rest of this tutorial will teach you how to use the command update-alternatives to choice what emacs alternative you would like to run by default. Debian has a way of setting up these system alternatives of your favorites programs, like to setup which editor is your main, or what browser is the default; using update-alternatives is not hard, but the manpage can be confusing on how it is done. To understand this command, I recommend you the tutorial http://linuxbasics.org/tutorials/using/debian_update-alternatives.
To setup which version you would like to use, run the following command, typing the alternative number you prefer:
$ update-alternatives --config emacs-snapshot There are 2 choices for the alternative emacs-snapshot (providing /usr/bin/emacs-snapshot). Selection Path Priority Status ------------------------------------------------------------------- 0 /usr/bin/emacs-snapshot-gtk 0 auto mode 1 /usr/bin/emacs-snapshot-gtk 0 manual mode * 2 /usr/bin/emacs-snapshot-nox 0 manual mode Press enter to keep the current choice[*], or type selection number:
Hit the enter key… next time you run emacs, it will load you preferred version.


Que tal um livro em português sobre o emacs ao estilo do vimbook:
http://vivaotux.blogspot.com/2009/01/nosso-livro-sobre-o-vim.html
É um livro colaborativo sobre o vim, tenho muita vontade de aprender também o emacs, mas queria
ter algo que os leitores do livro do vim estão tendo, a facilidade de pegar muitas dicas de bandeja.
Veleu pela dica, torço pelo surgimento do livro pois sei que o emacs é fenomenal mas queria mesmo
um incentivo maior para usa-lo tanto quanto uso o vim.
Fale Sérgio =)
Eu não tenho conhecimento suficiente de emacs para começar um livro ahahaha
Ainda nem descobri como reproduzir todas as minhas features preferidas de vim no emacs (tipo o visual block selection, ou como usar ediff). Mas descobri umas coisas bem massas nele, como o fato de vc compilar .emacs de Lisp para um bytecode, carrega muuuiiitooo mais rápido (vim não tem isso).
[ ]s
Pingback: Debian Linux: Пособие для гопников » Blog Archive » Installing Emacs Snapshot in Debian