Emacs in the real world – part 1
Forget Perl’s claims, Emacs really is the Swiss Army chainsaw of the *NIX world. Join Richard Smedley on the first of a three-part series revealing how you can do most of your day-to-day tasks without leaving Emacs – even if programming is a small or non-existent part of your typical day…
Yes, Emacs is a programmer’s editor. Yes, it comes from a 1960s command-line world. Yes, it’s not easy to start using, as one must adapt to new concepts and ridiculous key-stroke combinations. Yes it’s Anglocentric in menus and doesn’t really do right-to-left languages. But there must be an upside, right? Yes, once through the pain barrier – say a week of editing, and adding in other operations through Emacs – you’ll find the power is addictive.
In the first part of the series we’ll introduce some of the Emacs concepts you need to get you started, but also take a brief look at music and games. The main focus has to be on editing, just to get comfortable with the interface. Stick with it for the next few weeks because in the next part we will concentrate on organisation, with Emacs making a great project management tool, and PIM, as well as adding a bit more customisation. And in the final part we’ll look at everything internet, from email to updating your status on social networks, and point you to info on how to take things further.
Swiss Army chainsaw?
The UNIX way is small, specialised programs that do one job well, glued together to form a system that can easily be maintained. Emacs is a 500lb gorilla of a text editor that takes on many operating systems in functionality. This is because of its origins not within UNIX, but MIT’s Artificial Intelligence Lab, where Lisp machines used that language to modify themselves on the fly. Richard M Stallman coded the original Emacs – Editor MACroS – for the TECO line editor there in the 1970s with Guy Steele Jr, and rewrote it as GNU Emacs when he started the GNU project in the 1980s. Parts of the app, and even the config files, are written in the Elisp dialect of Lisp.
Emacs23 should be in your OS’s repository. Older versions can be extended to do almost everything we cover here
EMMS is available from here
.emacs customisation can be found here and many other places
For brevity, in this article we’re writing ‘C-x C‑s’ to mean ‘simultaneously press the Ctrl and X keys, release, then simultaneously press the Ctrl and S keys’ (this saves the file in the current buffer).
‘M-!’ means ‘press the Meta and ! keys’ – don’t have a Meta key? You’re not alone; it’s been a while since they were common in the wild. Alt is used instead, but no one’s in any hurry to update the documentation. You can also press and release Esc, then press !. Oh yes, and as ! is Shift+1 on most keyboards, that’s a bit more stretching!
Modern keyboards leave the Ctrl key isolated in the bottom left-hand corner. Even switching it with the Caps Lock key still leaves it under your little finger, and heavy Emacs users can develop nasty RSI (repetitive strain injury).
However, with a good keyboard, Alt and AltGr are equidistant from the centre, and swapping them with Ctrl means you can reach Ctrl with your thumbs while touch-typing. Better still, get an ergonomic keyboard, such as the Kinesis Contoured ones, which splits the keys between each hand and puts the modifier keys within easy reach of the thumbs. Other alternatives include chording keyboards or even foot or knee switches for Ctrl, Alt and Shift. A little extreme? Well, if you rely on typing all day to pay the rent, investing in your hands’ health is sensible.