-1

I need to use google style indentation in Java Application. I was given code to add to my .emacs file but its not working.

When I run the checkstyle code, it gives me tab errors.

This is what my .emacs file contains:

;; .emacs
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(diff-switches "-u")
 '(inhibit-startup-screen t))

;;; uncomment for CJK utf-8 support for non-Asian users
;; (require 'un-define)
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

;;; google conformant indentation for java
(add-hook 'java-mode-hook
          (lambda ()
            (progn
              (setq c-basic-offset 2)
              (c-set-offset 'case-label '+)
              (c-set-offset 'statement-cont '++))))

Could you please tell me what's wrong, or point me to a file i got replace it with?

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
user3541263
  • 219
  • 2
  • 5
  • 11

1 Answers1

0

Did you re-indent your Java buffer? You can do it with C-x h TAB.

abo-abo
  • 20,038
  • 3
  • 50
  • 71