June 2007

Installing Emacs 22 on Ubuntu Feisty Fawn

Update: Emacs22 is now available via apt. Before trying this try sudo apt-get install emacs22. You will still need to edit your .emacs file as instructed in the last paragraph to handle Java annotations.

Emacs 22 is now released. I have installed on my Ubuntu Feisty Fawn system. The package is not yet available on the apt repositories, so this required building from source. Here are the steps I followed:

Install prerequisites as follows:
sudo apt-get install g++
sudo apt-get install libgtk2.0-dev

Download the source from http://ftp.gnu.org/pub/gnu/emacs/emacs-22.1.tar.gz.

After unpacking, run:
./configure --with-gtk --enable-font-backend --with-xft --with-freetype
make
sudo make install

Voila! The executable is now installed at: /usr/local/bin/emacs-22.1

The java-mode still does not handle annotations correctly. Getting around this requires adding the following to the ~/.emacs file. It simply treats annotations as comments:

(add-hook
 'java-mode-hook
 '(lambda () "Treat Java 1.5 @-style annotations as comments."
    (setq c-comment-start-regexp "(@|/(/|[*][*]?))")
    (modify-syntax-entry ?@ "< b" java-mode-syntax-table)))

Fully Qualified Artifact Names

There is a lot to like about Restlet, including even the the way they name their artifacts. You can check it out in their maven repository. Instead of just naming their jar restlet-1.0.1.jar, they name it with the full base package name: org.restlet-1.0.1.jar.  That name better represents the actual name of the module.  It also makes it easier to track down which class belongs to which jar, which can be helpful when you have to manually assemble a set of jars for a driver or other resource connector not in your main project.

I am going to adopt this convention for my projects from here on out, and hope other projects will as well.