More Elisp posts
February 17, 2002
java extras minor mode

This elips stuff is getting out of hand! The original single file with a few functions in it has become four files that define an emacs minor mode to help when editing java code. Available for download here.

I find these quite useful and I spend my work days writing java so I hope they will be useful to others also. Functions are provided for managing import statements, inserting log4j debugging statements, and creating skeleton javadoc comments for methods.

In the future I want to add some sort of template system to make generation of repetitive code easier. The scenario I have in mind goes like this...

I see a piece of code I want to make into a reusable template so I set the emacs region to surround it and call the templatize command. This copies the code to a new buffer in templatize mode. Now, in templatize mode I can select regions of the buffer corresponding to the variables sections I want to make variable when the template is instantiated to create code. I think that there are only two sorts of regions in the basic system, those that get their values by prompting the user, and those whose values are provided by applying some sort of function to an input value. In addition to the standard elisp functions some java specific ones, such as initial-upcase and initial-downcase should be provided as well.

Once the code is marked up it is used to generate a data structure for saving to a file. I'm still debating how to save the data, as a simple structure or as some sort of function definition.

Posted by Alex at February 17, 2002 07:41 PM
Comments
Post a comment
Name:


Email Address:


URL:


Comments:


Remember info?