I admit, I’m an emacs philistine. I use it as a text editor and when I’ve got a machine or linux VM that I’m going to be using, I’ll set up “cperl-mode” with syntax colouring. I don’t even bother even creating a tags file to be able to bounce around files from the use of a function.method to its definition.
At an interview yesterday, I mentioned this and asked If my interviewers had ever used eclipse for development and their snorts said it all. So, this girded my loins to look at setting up a more productive emacs environment. So, a quick google gives us:
For a top hit in Google, that’s a bit rubbish.
- http://stackoverflow.com/questions/63421/using-emacs-as-an-ide suggests than an IDE should fulfil:
- Source code editor – OK, we have this, with shiny cperl mode. But I’m not entirely sure I’m making the most of the go-faster striped there. I shall dig more later.
- Compiler – I tend to get M-x compile to run my tests for me.
- Debugging – I cant’t remember the last time I used the perl debugger.
- Documentation Lookup – see below!
- Version Control – see below!
- OO features like class lookup and object inspector – is this just ETAGS?
Cperl’s documentation is here: http://www.emacswiki.org/emacs/CPerlMode. Suggestions that jump out at me from this are:
Using perltidy:
“For the emacs editor, first mark a region and then pipe it through perltidy. For example, to format an entire file, select it with C-x h and then pipe it with M-1 M-| and then perltidy. The numeric argument, M-1 causes the output from perltidy to replace the marked text. See “GNU Emacs Manual for more information, http://www.gnu.org/manual/emacs-20.3/html_node/emacs_toc.html
Yuk. That’s clunky.
You can access perldoc from within emacs:
In order to use perldoc from Emacs, type ‘M-x cperl-perldoc’, hit Return and type the keyword to look up.
Not sure what that gains. I usually run perldoc in an xterm!
The comments on this go on to suggest:
- vc.el – I had no luck in the early days getting svn integrated. I should probably take another look. This also attempts to gather together info on version control in emacs: http://alexott.net/en/writings/emacs-vcs/index.html. psvn looks powerful and might well have saved me time.
- http://ecb.sourceforge.net/ – the emacs code browser for zapping round file trees. Again, I just tend to end up having the modules I care about loaded and just switching between them in Dired. Maybe on a huge project with libraries?
Ah, perlnow looks interesting:
- Templates for starting off modules
- Syntax checking with going to errors
- Test script templates
I know Piers Cawley has done work on refactoctoring code with emacs, but I can’t find recent references to his work.
Finally, a big shout out to Aquamacs on the Mac. I find this to blend well with the Mac environment. GNU emacs on Linux. Don’t even think about Xemacs.
Still not entirely sure there’s anything in here I’ll make use of! Got any suggestions?
Related Posts: