[i’ve forgotten which of these does what, but they’re all in my .emacs file…]

make sure to create ~/backup/emacs_autosave first. this will create multiple snapshots of every file you edit and store them in that directory. this avoids having all the blah~ files in your current directory, and is useful if you want to revert to the way you had things 5 minutes ago.

Emacs Freex mode is a minor mode for organizing and editing a massively-hyperlinked database of your notes and ideas. It’s a personal wiki on steroids. Per Sederberg & I released the Emacs Freex code under the GPL two years ago.

There are probably still some teething problems with the installation instructions, and I think perhaps I could be clearer in the screencast. Do let me know what I can do to make it easier for new users.

I’ve been peripherally following the latest fad of full-screen “writing-focused” text editors. Here’s what I’ve learned so far: in the beginning, there was WriteRoom (Mac OS X, $24.95). WriteRoom is “just about you and your text.” WriteRoom begat DarkRoom (Windows + .NET, $0), which is also “just about you and your text” but requires a 22 MB runtime environment. DarkRoom begat JDarkRoom (Java, $0), which is just about you, your text, and somebody else’s multi-megabyte runtime environment.

Reading the change logs of these programs is like traveling back in time. Way back. Latest changes in JDarkRoom 8: Undo / Redo. Seriously. Version 8, and they now support undo. No offense, but what the fuck?

Anyway, so I had a nose around, and it turns out that Emacs has both undo/redo and very capable full screen capabilities. The EmacsWiki includes the following function, which I’ve renamed from ‘write-room’ and tweaked a little for the mac:

As may have become apparent, I harbour somewhat fanatically evangelical feelings about Emacs, though i’m very aware of its failings and idiosyncracies too.

Let me try my pitch for why you should learn Emacs in terms of economics. As a computer user, you want the biggest bang for your buck, the most reward for effort spent mastering a tool – one way to ensure this is for that tool to be useful in a variety of situations. Keyboard shortcuts, customizations, regular expressions and the like all provide enormous economies of scale. That is, they provide value, but they have a high marginal cost initially. However, the more you use them, that cost gets amortized, and so the more you profit from them.

Anyway, Emacs has a huge huge barrier to entry. Getting the hang of it is a pain, mainly because it has a huge amount of jargon and all of its keyboard shortcuts seem to involve 3 keys. The good news is that with a little effort, you can change them all to something a little more reasonable. Furthermore, once you’ve got the hang of a few, then you get to reuse them for almost everything you do.

Perhaps I should just quote Neal Stephenson, who said it best a long time ago:

“I use Emacs, which might be thought of as a thermonuclear word processor. It was created by Richard Stallman; enough said. It is written in Lisp, which is the only computer language that is beautiful. It is colossal, and yet it only edits straight ASCII text files, which is to say, no fonts, no boldface, no underlining. In other words, the engineer-hours that, in the case of Microsoft Word, were devoted to features like mail merge, and the ability to embed feature-length motion pictures in corporate memoranda, were, in the case of Emacs, focused with maniacal intensity on the deceptively simple-seeming problem of editing text. If you are a professional writer–i.e., if someone else is getting paid to worry about how your words are formatted and printed–Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish. For page layout and printing you can use TeX: a vast corpus of typesetting lore written in C and also available on the Net for free.”

Emacs is pretty lightweight relative to most modern editors, though by the time it loads all the modes and gets through all the uncompiled junk in my .emacs configuration, you wouldn’t know it.

Emacsclient is the solution – when you open a file with emacsclient, it doesn’t start up a whole new emacs – it just opens it in the running emacs, which is more or less instantaneous.

There are lots of webpages on this, so I won’t go into detail. Unfortunately, although you’d hope that calling ‘emacsclient’ would work just like ‘emacs’, this isn’t true:

I wanted to tell emacsclient to display an emacs frame, without feeding it any filename arguments to display. No dice.

If I don’t have a running emacs server (necessary for emacsclient to connect to), it just gives you an error message, rather than taking matters into its own hands and opening up a new emacs instance.

If I have emacs running on one computer, and I ssh into that computer, then I want to be able to type emacsclient and have a window show up. No dice. You have to explicitly feed it a display.

These issues were annoying enough that I nearly stopped using emacsclient. Various people have offered shell script hacks that handle some of these issues and more, but none of them solved the ones that bothered me. Plus, I like Python and I hate shell scripts. So I offer up a teeny python script, emf-on-display. If you alias ‘emf-on-display’ to something handy like ‘e’, then it makes emacsclient behave in a way that I find much more consistent with emacs.

P.S. I have not dealt with the possibility that you’re running this in the terminal, and you don’t have an X11 display at all.

P.P.S. I suspect that it requires emacs 22 (or gnuclient) to work, since it relies on being able to pass ‘make-frame-on-display’ as elisp code to be evaluated.