Emacs=Escape-Meta-Alt-Control-Sh*t

I tried. I really did. I gave it more than a week, but at the risk of turning Geek Drivel into the latest battleground in the editor holy wars, I found that I just can’t stand the venerable and much-venerated editor known as emacs.

I’m sure that emacs aficionados will say that a week simply isn’t enough time, and that if I gave it a proper try — say, six months or so — I’d grow to love it. And I’m sure they’re right; it’s a very powerful piece of software and can do just about anything under the sun… once you get used to it. But the learning curve is very steep, the keys for common tasks aren’t what my muscle-memory is used to, and quite frankly, I’m not willing to sacrifice full productivity for a month or more to master an editor, when there are other choices that are sufficiently powerful and a lot more user-friendly.

I finally switched to Eclipse (which I was already using for my C++ coding under Linux), with the Cusp Lisp plug-in. It’s fairly nice, though there are some annoyances with it. I haven’t tried any of the other Lisp plug-ins for Eclipse yet (they’re about halfway down the page), and probably won’t, so long as Cusp gets the job done. Only one of the others seems to be available at any rate.

17 Comments

  1. I don’t blame you, although SLIME makes it great for Lisp, the mnemonics to me for the various control and meta key combinations just don’t take hold. I can’t stand IDEs, however. Maybe if I had the hardware to run a Java IDE I could be forced to like it for some applications. (And people call Emacs bloated?)

    By the way, have you tried Emacs 22? It’s more “modern” and “graphical”, I think Ubuntu Feisty has a snapshot of a cvs version. Check out emacs-snapshot-gtk or some-such, that is, if you still want to learn Emacs. (Probably not, and I don’t blame you. For most stuff I’m a vi man.) There’s also XEmacs, which is more graphical as well, with more menu entries and hot buttons for various functions. Both are SLIME compatible…

  2. To each his own. 🙂

    No, I didn’t try Emacs 22. 21 is the latest version in Ubuntu’s apt-get system, so that’s what I ended up with. If I ever decide to try it again, I’ll look into that version.

  3. “[Cusp is] fairly nice, though there are some annoyances with it.”

    I am one of the Cusp developers. Can you describe these annoyances in details?

    The reason I am asking is that we preparing version 0.9 and after it is out I want to stop putting new features in and spend more time on polishing the plugin. I have my own list of things to do, but it would be great to know other users experience.

  4. Great! Thank you, I’ll be happy to describe them.

    The major one is that there doesn’t seem to be a shortcut-key to move the cursor to the REPL window. The F12 key, which goes to the editor window when in any other window, would be perfect: F12 from anywhere else would go to the editor, and F12 from the editor would go to the REPL window. But the REPL window seems to get the same key-bindings as the editor window, so that doesn’t seem to be possible.

    The others are minor editing things that would be nice. If you hit the Delete key at the end of a line, to join the next line to it, it would be nice if the editor would get rid of the spaces from the beginning of the second line, since that’s inevitably what you have to do next anyway. And if the home key would jump to the first non-whitespace on the line if it’s pressed a second time, like the C editor does, it would make my work easier.

    I’m sure I’ll think of others over time, but those are the biggest ones right now. 🙂

  5. “I am one of the Cusp developers. Can you describe these annoyances in details?”

    Even though the question wasn’t addressed specifically to me, I can’t miss out on this opportunity to jump in. 🙂

    One of the biggest annoyances I’ve found is the inability to recall what’s been typed in the REPL. Before Cusp, I used CLISP in which I could just use the up and down arrows to access previous commands in the REPL. In Cusp, if I want to run some commands repeatedly with just small changes (for example if I’m expanding out some macros using slightly different inputs each time), I either need to type the entire command in each time I want to run it, or copy the command and paste it each time I want to use it. If I do the latter, then anytime I copy something else, then I lose the command from memory. So, it would be nice if we could recall previous commands in the REPL simply by using the up and down arrows (or some similar feature).

    The second annoyance occurs sometimes when compiling. Usually, when there’s an error in the code, Cusp does a great job of pointing out approximately where it is and gives a good description of the problem. Yet there are times where, instead of saying there’s an error in the code, it simply says:

    couldn't remove "C:\\eclipse\\workspace\\myproject\\main.fasl":
    Permission denied
    [Condition of type SB-INT:SIMPLE-FILE-ERROR]

    That threw me for a loop the first time I saw it, and kept trying to figure out why it couldn’t remove the .fasl file. Now I know it means there’s a bug in my code somewhere, though where I don’t know. As soon as I locate the bug and fix it, then it compiles just fine. This seems to occur when I’m working with multiple backquotes and commas in macros (which makes it doubly annoying to have to sight-debug)

    That’s it for now. Best of luck with version 0.9. I’m looking forward to it!

  6. Got one more for you:

    Sometimes when I compile, it identifies an error in my code, and also at the same time brings up a window that says:


    Problem Occurred (This is the window title)
    “Compile” did not complete normally. Please see the log for more
    information. (Time of error: September 6, 2007 11:24:22 AM EDT)
    Reason:
    java.lang.NullPointerException

    There are two buttons in the window, “OK” and “Details >>”. The problem is, when you click on the window, it makes a sound, but nothing else happens. You can’t close it. You can’t move it. Clicking on the buttons does nothing. The editor has focus, but the window stays on top, so you can’t even ignore it because it’s covering up the code you’re trying to write. When I try to close eclipse to restart it, I get the usual “Exit Eclipse SDK?” window (which appears overtop of the error window above), but it won’t let me click ‘OK’, or ‘Cancel’ or even the X button at the top right. Eclipse is now effectively frozen, and the only way I can get back to my code is to kill the eclipse and sbcl processes and start again.

    So, there you go, one more for the list. Cheers!

  7. (FWIW, C-Squared is using it under Windows, and I’m using it under Linux. It looks like his Windows version doesn’t support Ctrl-P and Ctrl-N for moving through the history entries.)

  8. Head Geek:

    I remember that I was able to find a key combination to jump to REPL. Although I forgot what was that. I agree there should be more obvious way to discover it.

    Refined behavior of Delete and Home keys are already on my TODO list.

    C-Squared: Ctrl+P and Ctrl+N to move through the history of commands you have sent in REPL Also it has History button, so you can see all history

    I have experienced compiling annoyance and removed one reason for it (problem was related to file permissions) but it looks like there are more cases when it happens. I’ll try to track them down.

    Thanks for your feedback.

  9. I use and develop Cusp under Windows. What version of cusp do you use? (what does it print in REPL on startup?)

    The problem with java.lang.NullPointerException looks bad. I’ll try to fix it for 0.9 release.

  10. The following is printed in the REPL on startup: “You are running SBCL 1.0.2.21 via Cusp v0.8.174”

    Ctrl-P does nothing in my version, and Ctrl-N brings up Eclipse’s ‘New’ window.

    I’m using Version: 3.3.0 of Eclipse.

  11. The history button works fine. Also, the java.lang.NullPointerException seems to happen when I have too many parentheses.

  12. Just checked: Ctrl+N is default in Eclipse to create new file. We’ll probably need to change Ctrl+N to smth else in Cusp, although I already got used to it.

    You can set key combinations for many Lisp actions (including Next/Previous REPL commands) in Window->Preferences->Keys

  13. “the java.lang.NullPointerException seems to happen when I have too many parentheses” : if you can give me sample code I’ll try to fix this error today

  14. Thanks for the info on the keys.

    I don’t have a sample piece that gives me the null-pointer error at the moment, but next time I run into it, I’ll be sure to get a copy of it and (with the permission of Mr. Head Geek of course) paste it here.

  15. Hi Sergey,

    Looks like the lack of Ctrl-N and P was because I had an old version of Cusp. Head Geek helped me get the latest using the Eclipse updater.

    Cheers, CC

  16. Odd… his version said it was 0.8.174, both before updating and after, but he definitely has a newer version now than he did before. 😕

    The Home key seems to work the way I wanted it to on his version of Eclipse (3.3.0 with the latest Cusp). It doesn’t on mine (3.2.2 with the latest Cusp). Maybe it’s the older version of Eclipse, I can’t tell at this point.

  17. Thanks for feedback.

    It shows that we need to focus on polishing plugin and writing better documentation for it.

Comments are closed.