Jindent works great. I have this in my .emacs so reformatting the saved
current buffer is very easy (be sure to change the Jindent command line to
reflect the rules file you want to use):
;;; JIndent
(defun jindent ()
"Run the saved file for the current buffer through JIndent, a Java
source code formatter. JIndent results are displayed in an Emacs
output buffer. This version of the Emacs JIndent function uses the
JIndent option to create a backupfile (<name>.bak) and replace the
file with the newly formatted one. Emacs will then refresh the
buffer, obtaining the newly formatted code."
(interactive)
(shell-command (format "java Jindent -w -p c:/progra~1/jindent/jj.jin -f
%s" (buffer-name))))
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Ovidiu Predescu
Sent: Monday, August 07, 2000 4:44 PM
To: [EMAIL PROTECTED]
Cc: JDE
Subject: Re: lisp code to reformat brackets
On Mon, 7 Aug 2000 16:55:48 -0400, "Glen Cordrey"
<[EMAIL PROTECTED]
m> wrote:
> Does anyone know of any code, elisp or otherwise, which reformats an emacs
JDE
> buffer so the open and close braces are all on separate lines?
Although this is not free software, you can try Jindent:
http://www.jindent.de
Greetings,
Ovidiu