Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
56 views

How to change java file behaviour to use 2 character indentation

If I create a C file I get 2 character indentation which is what I want. However, if I create a java file, eg Hello.java then I am getting 4 character indentation. And I can't work out why. My ....
arcomber's user avatar
  • 229
1 vote
1 answer
172 views

How to set up K&R everywhere (1TBS) brace style in cc-mode?

I'd like Emacs to follow this indentation style: struct Foo { void bar() { for (int i=0; i<10; i++) { if (condition) { // code // code ...
sajmon's user avatar
  • 56
2 votes
1 answer
370 views

How to have c-offset style correctly detect a Java constructor and change indentation?

Currently my team (non-Emacs users) indent java like so: public DiskThresholdDecider(Settings settings, NodeSettingsService nodeSettingsService, ...
Lee H's user avatar
  • 2,737
5 votes
2 answers
1k views

Make emacs format Java more consistently

When I open Java files originally created and edited in Emacs, the indentation shows up correctly, as in the image below: However, when I open the same file in Sublime Text, or any other editor ...
Adam R's user avatar
  • 53
1 vote
1 answer
1k views

How to have emacs format/indent javadoc comments correctly?

Very new to emacs. (I only started day before yesterday.) I'm writing some Java and was wondering if there's an option or something I can set up so it will indent Javadoc comments correctly. What I ...
Reagankm's user avatar
  • 140
3 votes
1 answer
787 views

Modifying Java indentation style

I use Emacs for Android development and this has been bugging me lately. I'm trying to get the following indentation behaviour: submitBtn.setOnClickListener(new OnClickListener() { @Override ...
sjm's user avatar
  • 71
5 votes
1 answer
286 views

Get Emacs to indent fluent builder inside argument list

So emacs's java-mode handles indenting continued method invocations at the function body level out of the box, but it doesn't seem to handle them inside of an argument list. I'd like to override this ...
b4hand's user avatar
  • 2,055
5 votes
1 answer
746 views

How to configure specific Java indentation?

I have the following code from Intellij's indentation: public static String[] defaultMethodBlacklist = new String[]{ "getClass", "wait", "notify", "notifyAll", ...
Lee H's user avatar
  • 2,737