이클립스 (와 IntelliJ)와 이맥스 기본 자바 포맷 간의 주요 차이점은 이맥스가 함수 인수를 줄이는 것이 이전 인수를 가진 새로운 줄로 계속된다는 것입니다. 이맥스을 수행합니다
BigLongJavaStuff.doFoobarToQuux("argument 1",
"argument 2");
이클립스을 수행합니다
BigLongJavaStuff.doFoobarToQuux("argument 1",
"argument 2");
당신에 추가 다음 ~/이맥스 파일을 만들 것입니다 이맥스 자바 모드가 동일한 작업을 수행 :
;; eclipse-java-style is the same as the "java" style (copied from
;; cc-styles.el) with the addition of (arglist-cont-nonempty . ++) to
;; c-offsets-alist to make it more like default Eclipse formatting -- function
;; arguments starting on a new line are indented by 8 characters
;; (++ = 2 x normal offset) rather than lined up with the arguments on the
;; previous line
(defconst eclipse-java-style
'((c-basic-offset . 4)
(c-comment-only-line-offset . (0 . 0))
;; the following preserves Javadoc starter lines
(c-offsets-alist . ((inline-open . 0)
(topmost-intro-cont . +)
(statement-block-intro . +)
(knr-argdecl-intro . 5)
(substatement-open . +)
(substatement-label . +)
(label . +)
(statement-case-open . +)
(statement-cont . +)
(arglist-intro . c-lineup-arglist-intro-after-paren)
(arglist-close . c-lineup-arglist)
(access-label . 0)
(inher-cont . c-lineup-java-inher)
(func-decl-cont . c-lineup-java-throws)
(arglist-cont-nonempty . ++)
)))
"Eclipse Java Programming Style")
(c-add-style "ECLIPSE" eclipse-java-style)
(customize-set-variable 'c-default-style (quote ((java-mode . "eclipse") (awk-mode . "awk") (other . "gnu"))))
그래, 이클립스 들여 쓰기 (또는 최소한 그들이 사용하고있는 스타일)의 특성 때문에 피하려고했던 견과류와 볼트의 일종이다. 누군가가 이미 이클립스 스타일을 프로그래밍했기를 바랬다. 단지 refls tho를 가져 주셔서 감사합니다. – user98166
글쎄, 만약 당신이 그것을 끝내면 - 당신은 alist를 게시 할 수 있습니까? 여기 있을지도 몰라? – Arkadiy
http://stackoverflow.com/questions/5556558/getting-consistent-indentation-in-eclipse-and-emacs를 참조하십시오. Arkadiy가 말했듯이 누군가가 손톱을 감은다면 게시하십시오! –