[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Java Formatting



I am experiencing a situation where Emacs is incorrectly formatting my Java code.  This happens in some situations, but does not happen in others.

My sighted friends claim that, other than the abnormal formatting, the code appears to be correctly written.  I have also read through the Indenting section of the Emacs docs, as well as the docs for C++/Java mode.  I suspect that I may be missing some subtlety of programming style that is obvious from a visual standpoint.

Yanking the following region into an empty buffer and running m-x indent-region on it always snaps the text into this format...

----------
import java.io.*;

    public class test
    {
	public static void main(String[] args)
	{
 System.out.println("indenting fails to work by this point.");
     System.out.println("further lines are even worse!");
	 System.out.println("eventually, the formatting is unusable.");
	     }
    }

----------

The import is only present to fill the space of misc. imports that exist in other offending regions of code.

I'd appreciate any info or pointers to other information regarding this topic.

	


-- 
Bryan R. Smart                     E-Mail: bsmart@pobox.com
System Administrator               Home Page: http://www.pobox.com/~bsmart
Department of Computer Science     Home Phone: 843-953-2721
the College of Charleston          DCS Phone: 843-814-7627 (814-SMARt)

-----------------------------------------------------------------------------
       To unsubscribe or change your address send mail to
"emacspeak-request@cs.vassar.edu" with a subject of "unsubscribe" or "help"


Emacspeak Files | Subscribe | Unsubscribe