Hacking elisp: PerlySense

jplindstrom on 2005-06-27T00:36:29

The debate on the extremeperl mailing list a while ago about inadequate Perl IDEs and stuff got me going, so I started hacking a bit on my own. PPI being fresh on my radar helped a bit too.

The project is called PerlySense, to catch the intrigue and mystery of the more well-known IntelliSense. But while I believe the code quality is fine (300 tests so far) it's at 0.0.1 feature-wise, so it'll have to stay on my hard-drive just a little bit longer[1].

But the fun thing about this is that it forced me to try out elisp in order to get it integrated into Emacs (shell-command-to-string is my friend).

The verdict of elisp so far is: neat but strange.

The strange thing isn't the prefix notation, I kind of think I like it. It's all the things I want to do, which I know how to do but doesn't quite work the normal way, or isn't called anything that sounds familiar. So I stumble around a lot and research with a wide scope to hopefully catch something that fits my problem.

And the neat thing about elisp is that often there's something that's a perfect match. The Emacs API seems so very someone-had-this-problem-before-me. Of course, it helps stealing things from existing modules, things seem to fall in place easier then :)

This tutorial got me started in a very nice way. Unfortunately there are only a few of the planned chapters written, which is a real shame.

And after selective reading of the elisp manual, a lot of elisp source and this excellent summary of perl 2 lisp idioms I can now display method documentation in the messages area, module POD in a new buffer, and go to various places using horribly n00b elisp code.

It also helps to have elisp literate coworkers. So you get to know small things like:

* To compile the current defun, you just hit C-M-x. There's no need to enter lisp-interactive-mode and type C-j, and clean up the output from the buffer all the time.

* To actually figure out which line the runtime error happened at, it's useful to M-x set-variable debug-on-error to t.

* When you're in the debugger, you'r in a nested mode, so you need to hit Esc to stop it. Ahaaa...

Well, all in all a very nice experience so far.

[1] It's actually at http://www.DarSerMan.com/Perl/PerlySense/ too, for backup purposes and for the terminally curious. Consider it an alpha.