unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* java-mode indenting after @Override
@ 2011-04-22 17:47 Patrick Rutkowski
  2011-04-24 16:48 ` hazlup
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Rutkowski @ 2011-04-22 17:47 UTC (permalink / raw)
  To: help-gnu-emacs

Have a look at the following code snippet of Java indented under
java-mode:

=======================================================================
01:  package com.rutski89.HelloWorld;
02:  
03:  import android.app.Activity;
04:  import android.os.Bundle;
05:  
06:  public class HelloWorld extends Activity
07:  {
08:      /** Called when the activity is first created. */
09:      @Override
10:          public void onCreate(Bundle savedInstanceState)
11:      {
12:          super.onCreate(savedInstanceState);
13:          setContentView(R.layout.main);
14:      }
15:  }
=======================================================================

Line 10 is too deeply indented, any ideas about which c-set-offset
variable to change to fix that? The only customizations I already have
are:

(c-set-offset 'substatement-open 0)
(c-set-offset 'inline-open 0))

Many thanks in advance for any tips,
-Patrick




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: java-mode indenting after @Override
  2011-04-22 17:47 java-mode indenting after @Override Patrick Rutkowski
@ 2011-04-24 16:48 ` hazlup
  0 siblings, 0 replies; 2+ messages in thread
From: hazlup @ 2011-04-24 16:48 UTC (permalink / raw)
  To: Help-gnu-emacs


I'm using this in my .emacs

(add-hook 'java-mode-hook '(lambda () "Treat Java 1.5 @-style annotations as
comments."
			     (setq c-comment-start-regexp "\\(@\\|/\\(/\\|[*][*]?\\)\\)")
			     (modify-syntax-entry ?@ "< b" java-mode-syntax-table)))



-- 
View this message in context: http://old.nabble.com/java-mode-indenting-after-%40Override-tp31463606p31467078.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-24 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-22 17:47 java-mode indenting after @Override Patrick Rutkowski
2011-04-24 16:48 ` hazlup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).