Thursday, August 27, 2009

Emacs/Perl integration

In answer to YAPC::EU::2009 's call for volunteers for the beginner's track, I offered a presentation on Perl development under Emacs. Part of the motivation for doing that talk was to force myself to have a look at various Emacs extensions (so far I'd been using just the standard cperl-mode coming with Emacs, which is already very rich in features). So here are the conclusions.

[Disclaimer: this was a quick, informal survey; maybe I misunderstood some points, or maybe some of the difficulties encountered were bound to my specific environment (Emacs on Win32); so I hope I don't do any injustice to these modules]
  • Emacs::EPL looks like it was a very nice integration work. For example it could redirect things like STDIN/STDOUT or %ENV variables for Perl scripts running under Emacs, so that user interaction would go through Emacs mechanisms (e.g. the minibuffer). It also allowed people to write Emacs extensions in Perl instead of e-lisp ! This sounds really interesting, but unfortunately it hasn't been updated since 2001 and I couldn't get it to work. I really wish that somebody would resurrect that module.
  • Devel::PerlySense is an ambitious project with lots of features; it runs a Perl process in the background to run/debug code, perform static analysis, etc. However it was so CPU-intensive that I found it hardly usable for daily work.
  • Sepia is an active project (latest release July 09), also running an inferior Perl process, also quite rich in features (it goes as far as analyzing Perl opcodes to deduce information about packages/methods/etc.). Here I had another problem : it would only recognize core modules and functions. I didn't find how to make it understand that there was also some code under perl/site/lib !
  • Emacs::PDE installed smoothly and provides a number of nice features, like perldoc/perltidy/perlcritic integration, tree views of sources/documentation, interactive perl shell, etc.

So in the coming weeks I plan to learn more about Emacs::PDE and maybe add it to my collection of tools for daily work.

1 comment:

  1. Sounds like a terrific talk!

    I sometimes use 'call-process "perl"' to write simple Emacs extensions in Perl.

    ReplyDelete