Emacs

Emacs is a text editor with ambitions to be an operating system. I do not use Emacs, though I once did, and I still find it intriguing. I’d like to find something similar that acts more like a Windows program.

GNU Emacs began in 1984 and has been in constant development ever since. The current version is 23.1. How many applications from 1984 are still in widespread use today? The only other one that comes to mind is TeX.

I used Emacs in graduate school and for a few years after that. I was fairly fluent with Emacs, though I never customized it much. I intended to learn Emacs Lisp and all that, but it never happened.

When I started developing Windows software I used Emacs at first, but the benefits of Visual Studio soon persuaded me give up my old editor. It was much easier to go with the flow.

I’ve revisited Emacs a couple times over the years. I still have some of the keystrokes burned into my memory. I use it on Linux now and then, but I mostly work on Windows, and my experience using Emacs on Windows has been frustrating to say the least. Tasks that are trivial in any Windows application, such as printing and spell checking, are surprisingly difficult to set up in Emacs. I’m sure it is possible to resolve these problems, though I never did.

The problems with printing and spell checking are part of the larger issue that Emacs is so idiosyncratic. It behaves nothing like a typical Windows program. Some people may say that’s a good thing. But it makes life more complicated if you switch between Emacs and more conventional Windows software.

Emacs is no more a typical Mac application than it is a typical Windows application. And yet my impression is that this is less of a problem for Mac users. I’d like to understand whether this is true and if so why.

One of the things I liked about Emacs was the way you could “live” there. An expert Emacs user might work inside Emacs all day, using it as an editor, debugger, shell, file system explorer, email program, etc. Steve Yegge is such an expert. When he blogged about his move from Windows to Mac,  he said the main reason for the switch was that he prefers the appearance of the fonts on a Mac. Changing operating systems was not a big deal for Yegge because he didn’t really live in Windows before, nor does he live in OS X now. He lives in Emacs. He concluded his essay by saying

So I’ll keep using my Macs. They’re all just plumbing for Emacs, anyway. And now my plumbing has nicer fonts.

Living inside Emacs comes at a price. Part of that price is writing lots of Emacs Lisp to glue things together. Another part of that price is the commitment to practicing using Emacs. As Yegge says elsewhere

… you need to make a serious, lifelong commitment to Emacs in order to master it. … So it’s not an editor for the faint of heart …

Yikes! I’m not ready to make a serious, lifelong commitment to a piece of software. To my wife? Yes. To my text editor? No.

One of the best features of Emacs is that it has custom “modes” for various kinds of files. Instead of using a separate program for editing every kind of file, Emacs users use one program with different modes. As soon as a new file type comes out, say for a new programming language, someone will post an Emacs mode for that new language.

I’d like to find an editor on Windows that is analogous to Emacs. By that I mostly have in mind a powerful, highly configurable editor with support for many file types. I’d want it to behave like a Windows application, not a foreign transplant, and integrate well with .NET.

There was a project to create such an editor, nicknamed Emacs.NET. It was announced in late 2007. It sounds like the project is still alive, but it doesn’t seem all that promising. [Update: maybe it’s dead.]

I’ve looked at a few Windows editors that claim to be highly configurable but are not well documented. So if such an editor is configurable, it’s configurable for the person who wrote it or possibly for anyone else willing to study the source code.

Any suggestions for a general purpose Windows editor? For starters, I’d be pleased to find something that’s good at editing LaTeX and HTML.

Update (2 April 2010): I’ve decided to give Emacs another try.

Related post: This post started out as an update to my earlier post One program to rule them all.

26 thoughts on “Emacs

  1. I’ve been very happy with Visual Slick Edit. Unfortunately the OS X version doesn’t integrate in OS X well – meta keys are all wrong (windowsisch). But on OS/2 and Windows I’d take it any time to “live in”. :)

  2. I use Eclipse for just about everything. It’s great for R (using StatET) and Python. It comes with a good HTML editor (if you install a version with the Web Tools Platform). It even has good LaTeX support (via TeXlipse). For R/LaTeX users, StatET also support Sweave. Eclipse is especially nice if you use version control for everything, since there are svn and other clients that integrate into Eclipse.

    I don’t work at all with .NET, but I’m told that the combination of Emonic and NAnt works well.

  3. Emacs is no more a typical Mac application than it is a typical Windows application. And yet my impression is that this is less of a problem for Mac users. I’d like to understand whether this is true and if so why.

    I’d say this is in part because emacs can be run within the shell. Many of the Mac hackers I know use it this way, and I use it that way myself (albeit under Linux). It acts like a natural extension to the shell, which is an almost identical environment under each *nix. There’s not a similar shared context for Windows users.

  4. I live “partially” in emacs, except web browsing and checking email. That’s not because I know lots of emacs lisp, but most of my time is spent on working c or fortran codes, and it’s REALLY nice to stay there all day long.

  5. For the last few months I have been using PSPad ( http://www.pspad.com/en/pspad.htm) whenever I use windows. Linux is my primary OS so my experience with PSPad is somewhat limited and so far i have used it primarily for txt, HTML, CSS and python but it seems be a pretty power text editor and relatively easy to use. It is certainly worth a try and should be able to handle LaTeX, tho I have not used it for such. Has a nice collection of plugins and supports scripting and so on. Of course it is no emacs, but that is a good thing IMHO. My main criticisms with it are that I use it on a netbook and it is slow to load at first and two I really don’t like the toolbar clutter and usually hide them.

  6. Try E-text editor. Its not free, but its built on the textmate setup structure. So all the bundles that go into textmate work on e. Theree is some emacs bindings support, and the usual good project support that textmate has. Finally, it comes bundled with cygwin which makes windows somewhat acceptable.

  7. I agree with Brendan. Emacs and Vim and Bash are all very ingrained in what we know as the larger UNIX ecosystem. Switching from one flavor of UNIX to the next, say from OS X to Linux to Solaris, is not a big deal because all the software you know and love is still there and behaves almost exactly the same.

    I live in the shell. My mail and chat are on a server in Iowa that I SSH into, and my editor is on whatever system I happen to be writing files for that day. Other than some deep system utilities and package management, they all look the same.

    I doubt the TextMate users out there would say Emacs feels natural.

  8. Anyone replying to this post by suggesting alternate editors does not understand what Emacs is.

    Emacs is not a text editor; it is an operating environment. Like most software from decades ago, it is actually much better than most software available today, but only for very smart people.

    Emacs itself is just a shadow of the Lisp machines of the 80s. If you have never been amazed at one what one skilled Lisp programmer can do, then you have never met a skilled Lisp programmer. (On the other hand, there are limits to what one person can do, no matter how brilliant, which is one reason Lisp failed. But that is a rant for another time.)

    “Emacs is so idiosyncratic”? Since it predates Windows and runs on every O/S from the past 30 years, it would be more accurate to say that Windows is idiosyncratic…

  9. The reason Emacs is better on OS X is because of the modifier keys on OS X. See this for a history refresher:

    http://www.roughlydrafted.com/2007/08/11/how-apple-keyboards-lost-a-logo-and-windows-pcs-gained-one/

    When Windows 95 debuted, Microsoft made the keyboard manufacturers add a nearly useless Windows key. Up to that point (around Windows 3.1 era) Microsoft threw out the “Control” aspects of the Ctrl key and basically turned it into a Command key. The Windows key was unable to provide application shortcuts like Copy, Paste, Undo, Close Window, etc. because the Ctrl key was used for this in all Windows software (better than the inconsistent keys across DOS programs).

    Jump back to the Mac: it always had consistent cross-application shortcuts: Cmd+X, Z, V, W for cut, undo, paste, close, etc. and yet (after Steve Jobs left) when the Ctrl key was added it available for Ctrl sequences. When OS X debuted (I believe) all text boxes and input fields were given Emacs key bindings for stuff like kill (Ctrl+K) and yank (Ctrl+Y) and right-delete (Ctrl+D), and many more that I don’t use regularly [1].

    The best thing about this arrangement is that most OS X users don’t know about the great system-wide Emacs key bindings and don’t need to know since they don’t get in the way, but advanced users/programmers get the ubiquitous shortcuts. This also means that OS X-ish Command shortcuts (Cmd+X, +V, +Z and/or using the system clipboard, or Cmd+S for save, Cmd+W for close, etc.) coexist with the old-school Ctrl key Emacs-y shortcuts in the wonderful Aquamacs.

    As a daily user of Windows and Mac OS X I prefer the OS X modifier key layout even on a more compact laptop keyboard. I use Emacs in the Terminal and find it quite able for most LaTeX, HTML, or code editing.

    For Windows I use EditPad lite since it’s simple. I use Visual Studio for C#/C++ code. I use NotePad++ for HTML. NotePad++ is good, not great. It suffers from feature bloat and poor defaults (for example, Ctrl+F search is indepent of Ctrl+I interactive search, an annoying tragedy, probably from too many chefs) but NotePad++ can usually be forced to work the way you want and the HTML code folding is invaluable. Never got spell check to work in NP++.

    [1] see the right two columns in this table: http://en.wikipedia.org/wiki/Control_key#Examples for Unix/readline keys and Emacs keys.

  10. Slavomir Kaslev

    I guess that the closest thing that comes to emacs in flexibility and programmability is Eclipse. I said “I guess”, because I’ve never used Eclipse much. Blame me, but I much more prefer emacs’s old-school-lisp idiosyncrasy than eclipse’s java-oops-style one.

    I am a regular emacs user. On linux I live in emacs and on windows I drift between Visual Studio for C++ and emacs for everything else.

    My advice is to give emacs another shot. Emacs on windows is quite bearable with cygwin. You can check out my emacs configuration at github.com/skaslev/emacs.d I’ve already converted two colleagues (cg artists!) to use emacs with this. Here’s what one of them (Marin Petrov) has written: http://scroll-lock.eu/index.php?option=com_content&view=article&id=143:my-battle-of-the-editors&catid=1:scroll-blog#JOSC_TOP .

  11. @Slavomir:

    Cygwin + PuTTY (search for puttycyg) on Windows makes Emacs nearly Linux-like. A Windows world without Cygwin and PuTTY is a painful world.

  12. Vi came in 1976 and is in common use today, through the popular vim incarnation, and as the default editor at the system level for a lot of linux- and bsd-powered devices.

    And refreshingly, vi is an editor with ambitions to be – an editor. Not a mail client, class browser, typesetting engine or z-code interpreter.

  13. Thanks for the suggestions everyone.

    @Jared: Thanks for the Mac/Windows keyboard background. That explains a lot.

    @Janne: Your comment made me think it might be good to separate Emacs-the-editor from Emacs-the-Swiss-Army-knife for the sake of discussion.

    @Beetle: You are correct. I started to mention that when I was writing the post, but I decided to start my timeline with GNU Emacs.

    @Nemo: I understand your point about Emacs being powerful for “very smart people” but I might rephrase that as “people who are dedicated to using it regularly.” Along those lines, see my post three-hour a week language. A very smart person who doesn’t do much text editing is probably better off with a different editor.

  14. You might want to look into EditPadPro. It’s no emacs, but has syntax highlighting and you can send text to apps such as R and python, and get back the output. I own it and I think it’s worth it.

  15. I am a linux to mac convert and have found TextMate a great replacement for emacs. Now TextMate is Mac-exclusive, but it has recently been brought to my attention that one of its greatest features, the language bundles, are also supported by a Windows-editor:

    http://www.e-texteditor.com/

    The language bundles are similar to emacs-modes and makes me able to use Textmate as my editor for everything I write (python, Java, R, php, html, css, latex …). They obviously do not cover the enormous range that emacs-modes does, but they generally work very well (I once discovered that emacs even had a mode for editing protein databank coordinate files).

  16. Tried emacs, ended up with Vim. What turned me off emacs:

    • Long chorded commands are a recipe for RSI. This can be worked around with remapping to Ctrl to something reasonable like Alt. The big Alt keys on a MS Natural keyboard are very easy to thumb (the strongest finger). The long-winded-do-something commands can be remapped to something short. But then you need to carry your mapping file around with you. BTW, Paul Graham, the Lisp guru, switched to Vim for precisely this reason. Vi is everywhere in the Unix world and has reasonable defaults.
    • Emacs/XEmacs schism.
    • Infrequent releases.
    • Ugly GUI (not much of a concern, since I’ve become a devout Terminalist). Got smooth fonts only recently.
    • Vim may not be the as light as vi used to be, but emacs is a pig.

    The only thing that I don’t like about Vim is that it has yet another custom scripting language. Though it has bindings for Tcl, Python, Ruby, etc., most of the plugins and much of the core functionality are written in its own scripting language.

    P.S. Bash commandline has a vi editing mode: set -o vi.

  17. Emacs/XEmacs schism.

    This may have been a problem at the time, but it’s a nonissue right now.

    Infrequent releases.

    I find this to be an inconsistent complaint. It’s just an editor, so why the need for frequent releases? The only reason I have “needed” to upgrade Emacs lately is to run Emacs apps that are not simply text editing (e.g. org-mode, calc, etc).

    Although I’ll grant this may have been a problem at some point in the past.

    Vim may not be the as light as vi used to be, but emacs is a pig.

    Again, not a concern ever since I started using Emacs heavily. It’s fast enough for everything I need. A few versions ago it took a long time to load a big file, but no more. Vim may still be faster, but few will notice the difference.

  18. Another editor from the early 1980s that’s still around is Vedit. I’ve been using it continuously since 1982. However, my current preference for a cross-platform editor is a relative newcomer: Geany (http://www.geany.org/). It has multiple language support, including syntax highlighting, code folding, autocompletion, object indexing, and an architecture for plugins (though not many available).

  19. I switched from Vim to Sublime Text for very much the same reason. It feels right on Windows and it’s very versatile. I think you use Python quite a lot, so the fact that Python’s the embedded language to interact with its API is a plus.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>