【发布时间】:2015-07-15 01:43:19
【问题描述】:
我需要在 Java 应用程序中使用 google 样式的缩进。我获得了要添加到我的 .emacs 文件的代码,但它不起作用。
当我运行 checkstyle 代码时,它会给我标签错误。
这是我的 .emacs 文件包含的内容:
;; .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 '++))))
您能告诉我出了什么问题,或者指出我要替换它的文件吗?
【问题讨论】:
标签: java emacs indentation google-style-guide