Sunday, October 07, 2007

Emacs: Yet Another Cool High-Tech Thing

Two years ago, I wrote about Servant Salamander. In that post, I described how Servant Salamander substituted nicely for Norton Commander when I made the switch from MS-DOS to Windows NT.

The other software substitute I made was to replace my favorite text editor, Brief. When I started using Brief, it was by a company called "Underware." When I stopped using it, it had been taken over by Borland. They had no plans to make it Windows-compatible.

I loved Brief's ability to record and playback keyboard macros. It had undo. Its regular expression search and replace capability was powerful. It could cut and paste columns of text. It could be scripted. It supported multiple windows.

I continued to use Brief on Windows NT, even though its cut and paste didn't work with the Windows clipboard. And I recall having display problems at certain video resolutions.

So I set off in search of a new Windows text editor. The minimum requirements were:
  • Column marking, cutting, pasting.
  • Undo.
  • Regular expression search / replace.
  • Keystroke macros.
  • Windows compatible.
I wanted an editor that could be scripted. And even better, one with the same keystrokes as Brief, or with a reconfigurable keyboard.

I came across Crisp, Zeus and then Vedit a bit later.

I rejected Crisp almost immediately, even though it seemed to be the ideal replacement. The problem was that it was unstable. Or, more accurately, it made my computer unstable. So I dropped it quickly.

I was mostly happy with Zeus. But sometimes I needed to edit binary files, and one thing I did not like was that Zeus could not handle null characters. (And it wasn't 100% Brief-compatible.) That's why I got Vedit. Vedit did a great job with all kinds of files of all sizes. I was even able to edit EBCDIC files, which helped when I was writing an EBCDIC to ASCII translator. But I never got comfortable with Vedit, so I continued to use Zeus primarily.

One day I decided to try another search for the Ultimate Text Editor. Someone recommended Gnu Emacs.

Emacs was "sort of" Brief compatible. In fact, it was Crisp-compatible with its Crisp-mode Lisp add-on. But in reviewing Emacs, I came across the advice that it's best to learn the native key-mapping. So that's what I did, back in 2001.

It was a bit hard to get used Emacs, and I did have to remap the keyboard a tiny bit. For example, back then, Emacs would interpret the Del key as Backspace, which deletes the previous character instead of the next character. (This is not true of more recent versions.) Also, I stumbled over Emacs terminology. For example, it's not "Cut" and "Paste" but rather "Kill" and "Yank."

But all the effort I put in to it was well worth it. Now, I don't bother to write text-manipulation programs because it's easier (and more fun) to script Emacs to perform that kind of work. I enjoy using Emacs Planner to keep track of tasks and notes that pertain to numerous work projects. And at one time, I enjoyed using the newsreader Gnus with it's wonderful ability to score message threads based on any number of regular expression filters I could come up with.

Emacs is licensed under the GNU General Public License, which means that it's free, not only in the sense that you can obtain it without cost, but also that you are free to modify and distribute the software, provided you pass along this same freedom.

Emacs is amazing. It is constantly being improved by intelligent people who demand great things from their programs. It can run on many different platforms. Try it out!

No comments: