[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]
Re: JDE のインデント設定について
- X-ml-count: 4316
- Subject: Re: JDE のインデント設定について
- From: Koichiro Ohba <koichiro@xxxxxxxxxxx>
- Date: Fri, 04 Oct 2002 18:32:54 +0900
- User-agent: Wanderlust/2.9.15 (Unchained Melody) SEMI/1.14.4 (Hosorogi) FLIM/1.14.4 (Kashiharajingū-mae) APEL/10.3 Emacs/21.1 (i386-msvc-nt5.0.2195) MULE/5.0 (SAKAKI) Meadow/1.99 Alpha3 (HATAITA)
>>>>> [meadow-users-jp : No.4315]
>>>>> tadahiro takahashi <takahashi01.hts@xxxxxxxxxxxxxxx> さま曰く:
> これをなんとかしたいのですが
> 設定方法を教えていただけないでしょうか?
Info の CC mode の項に詳しい説明がありますよ。
> (add-hook 'jde-mode-hook
> '(lambda ()
> (setq c-set-offset 'xxxxx 0)
> ))
> のように設定すればよいことは Web で調べてわかっています。
> どの変数に設定すればブロック文の括弧のインデントが調節できるかわかって
> いません。
> block-list-open , brace-open などで試したのですがうまくできませんでした。
おしい!
substatement-open 0
ですね。
ウチでは Sun の Code Conventions
<http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html>
に従うように
if ( true ) {
System.out.println("true");
}
なんですが、以下のような感じで設定しています。
----------------------------------------------------------------------
(setq c-default-style
'((java-mode . "java") (other . "gnu")))
(defconst my-java-style
'((c-basic-offset . 4)
(c-comment-only-line-offset . (0 . 0))
;; the following preserves Javadoc starter lines
(c-hanging-comment-starter-p . nil)
(c-offsets-alist . ((inline-open . 0)
(topmost-intro-cont . +)
(statement-block-intro . +)
(knr-argdecl-intro . 5)
(substatement-open . +)
(label . 0)
(statement-case-open . +)
(statement-cont . +)
;(arglist-intro . c-lineup-arglist-intro-after-paren)
;(arglist-close . c-lineup-arglist)
(arglist-intro . +)
(arglist-close . 0)
(access-label . 0)
(inher-cont . c-lineup-java-inher)
(func-decl-cont . c-lineup-java-throws)))
(c-hanging-braces-alist . ((brace-list-open)
(brace-entry-open)
(class-open after)
(inline-open after)
(substatement-open after)
(block-close . c-snug-do-while)
(extern-lang-open after)
(inexpr-class-open after)
(inexpr-class-close before)))
)
"My Java Programming Style")
(defun my-java-mode-hook ()
(c-add-style "PERSONAL" my-java-style t)
(setq tab-width 4)
(define-key java-mode-map "\C-m" 'newline-and-indent))
(add-hook 'java-mode-hook 'my-java-mode-hook)
----------------------------------------------------------------------
--
koichiro <koichiro@xxxxxxxxxxx>