Ubuntu – How to install the latest version of EMACS and pick the appropriate UI

emacsinstallationrepositorytext-editor

I'm running the latest Kubuntu (12.04 beta 2) and I would like to run the latest emacs (currently v24). The repos are one version behind. What's the best way to install v24 or later (and avoid future version conflicts)?

Also, is there any reason not to aways use the GUI version of emacs if X is running? For example, could I set the GUI emacs version as the default text editor and use it to edit cron jobs (crontab -e)? I'm assuming the answer is yes, but since I haven't done that yet (my default editor is nano), I want to check if there are reasons I should leave nano as the default editor.

Usually when I'm working on the command line I end up using nano. Now that I think about it, I have no idea why I keep doing that. Is there any downside to calling a GUI editor when working in an X terminal?

EDIT: I briefly tested these two versions

  • GNU Emacs 24.0.94.1 (x86_64-pc-linux-gnu, GTK+ Version 3.3.20) from
  • GNU Emacs 23.3.1 (x86_64-pc-linux-gnu) installed by default in Kubuntu.

This post explains some of the differences between versions.

Unfortunately (for me) the defaults installed version (23.3.1, 23.3+1-1ubuntu9) is the nox version.

Package: emacs23-nox
Status: install ok installed
Version: 23.3+1-1ubuntu9
Replaces: emacs23, emacs23-gtk, emacs23-lucid

The package with version 24 opens in GUI mode by default. That's what I prefer. Some of the version 24 changes that interest me are listed in the references below.

But there appear to be a multitude of different packages and versions I could install.

References:

Best Answer

If you must chase the very latest version, then you can always get the source and compile it yourself. Unless you know of some killer new feature that emacs24 has though, I'd not waste the time and just use the one that ships with Ubuntu.

There's no downsides to calling it directly, but the emacs way is to start up one emacs session when you log on and never close it. You can export EDITOR=emacsclient and run M-x server-start in emacs and things like crontab -e will prompt emacs to open the file in the other window. When you are done, you hit C-x C-# to unblock the emacsclient.

If you prefer to keep the editing in the terminal window ( of course, you can just run M-x ansi-term and do your terminal work inside an emacs buffer ), you can add -t to the emacsclient command and it will open a new emacs frame on that terminal so you can do your editing in the terminal, but still have access to all of your other buffers, the kill ring, etc.