I just can’t wait for Emacs24 to be released! (I know, it’s in beta and it’ll be officially released Real Soon Now, but my catalyst is Technomancy’s ESK2 which is such an improvement over ESK1, and it needs Emacs 24).
In my last post I had steps to build emacs from source-code. This is worth following for hacker cred, but it soon gets tedious if you have a lot of systems to put emacs on. As pointed out by a few readers, there are some snapshot builds available for different platforms. This post lists steps for installing the pre-built snapshots, for the three operating systems that I use.
Debian
As pointed out earlier, you can get emacs-snapshot builds for Debian from Julien Danjou (of awesome fame). That page does have instructions, but I’ll list them here anyway:
- Import the key (this is a one-line pipeline, broken for display only):
$ wget -q -O - http://emacs.naquadah.org/key.gpg | sudo apt-key add -
- Add the snapshot repository to your
/etc/apt/sources.list(by hand). Here’s Julien’s “stable” snapshot:deb http://emacs.naquadah.org/ stable/ deb-src http://emacs.naquadah.org/ stable/
- Update your package database
$ sudo aptitude update
- Install emacs-snapshot
$ sudo aptitude install
emacs-snapshot
Ubuntu
I’m running Ubuntu 11.10 in a VirtualBox on work’s Windows 7 machine. As mentioned at Julien Danjou’s page,
Damien Cassou makes a version of the same emacs-snapshot for Ubuntu, which is hosted at Launchpad. You add it and install simalarly:
- Add the PPA (Personal Package Archive). This also imports the key:
$ sudo add-apt-repository ppa:cassou/emacs
- Update your package database
$ sudo apt-get update
- Install emacs-snapshot
$ sudo apt-get install emacs-snapshot
Windows
It’s handy to have a native Windows emacs as well as the one in the VM. Of course being Windows, it’s more complicated to install and configure… This has been tested on Windows 7:
- Download the latest PKZIP-ed binary from Google Code
- Unpack the ZIP (Windows Explorer can open ZIP files — but 7zip is mich nicer). I like to unpack emacs in
c:\Applications\emacs<version> so I can maintain several different versions at once - (optional) Put a windows symlink to the version of emacs you want to use. This assumes your C: drive is formatted with NTFS, which on most Windows systems it is. The symlink can then be used for your %PATH% later and you won’t have to edit the variable again to change versions, which for some odd reason is a convoluted operation in Windows… Type the following in a CMD.EXE prompt:
C:\> CD C:\Applications C:\Applications\> MKLINK /D emacs emacs<version>
- Create an Environment Variable called
%HOME%that refers to your Windows home directory (C:\Users\<username>). This is so that you can put your.emacs.din your home directory, and Emacs will find it:- Open Windows Explorer
- Right-click on “My Computer“, choose “Properties“
- Choose “Advance system settings” (Really? what’s so advanced about an environment variable?)
- Make sure the “Advanced” tab of the System Properties dialog is selected, then press the “Environment Variables…” button
- Press the top “New…” button (to add a personal variable, rather than system variable)
- in the “Variable name:” field, enter
HOME. In the “Variable value:” field, put%USERPROFILE%, press “OK” button - Press the other “OK” button to dismiss the Environment Varables dialog
- Press yet another “OK” button to dismiss the System Properties dialog
- Put emacs in your
%PATH%. Use the same steps above to edit the Sytem variable PATH and add the path to Emacs (;C:\Applications\emacs\binif you put a symlink in step 3)
Personal Emacs settings
You can now put your emacs settings into ~/.emacs.d (that’s %HOME%\.emacs.d for Windows). I highly recommend Technomancy‘s Emacs Starter Kit (version 2).
My own ~/.emacs.d/init.el is set up to bootstrap ESK2 and a few favourite packages, just as Technomancy describes.
One package I’d like to mention here is “ergoemacs-keybindings” which gives more modern/ergonomic key bindings to emacs. Together with cua-mode, it makes Emacs behave very nicely. Currently though I notice there’s a problem loading the package (maybe it’s autoloads aren’t right yet?) So I have to hack it as described in the package’s README, (with a hard-coded path to the package directory, that’ll break if I update it in the future because it has the package version) but I hope to fix it and send a patch for Xah Real Soon Now… In the mean-time, here’s a snippet:
;;;; egroemacs keybindings (setenv "ERGOEMACS_KEYBOARD_LAYOUT" "dv") ; US Dvorak (Ergonomic) ;; FIX: for some reason the library isn't loading from the package? ;; Have to put full path to the load file, which is brittle (when (package-installed-p 'ergoemacs-keybindings) (load-file "~/.emacs.d/elpa/ergoemacs-keybindings-5.3.9/ergoemacs-keybindings.el") (ergoemacs-mode 1) (cua-mode 1))
(btw, the lisp-ish CSH above is done by using WordPress’ sourcecode block and specifying “clojure” for the language)
damnit wordpress, stop screwing with my post! gah!
Emacs Prelude https://github.com/bbatsov/emacs-prelude is another great Emacs 24 config package. While less modular than ESK2 I find it much more powerful.
By all means do shop around for config packages!
Personally I don’t like Emacs Prelude — it’s too prescriptive, and what is with disabling the arrow keys in favour of the traditional Emacs C-n C-p etc? Sure map the cursor (“point”) movement commands to the home row (ergo-emacs does this in a sensible fashion) but don’t disable the arrows, that’s just stupid. There are a number of other choices it makes of the same flavour which turn me off it.
Reblogged this on Gà con's Blog.
Emacs 24.0.94 was just released. Assuming you done all above, you can upgrade like so:
For Debian/Ubuntu just do this in a Terminal:
sudo apt-get update
sudo apt-get upgrade emacs-snapshot
For Windows, you need to manually download from http://alpha.gnu.org/gnu/emacs/pretest/windows/ and then unpack in C:\Applications. Then in a DOS prompt, type the following:
cd c:\Applications
rmdir emacs
mklink /d emacs emacs-24.0.94
FWIW, I pull emacs from bzr and build it almost daily. It’s quite stable.