Hello,

  What I have done is created a new style that sets the indent the way
I like it.  You can use the following and change what you need.  This
adds a new style to the list of available styles for cc-mode to use
when writing c-based coded, such as Java.

(c-add-style "dwfa-java"
  '("java"
     (c-basic-offset . 2)
     (c-backslash-column . 49)
     (c-offsets-alist
       (case-label . +)
       (substatement-open  . 0)
     )
     (c-hanging-braces-alist
       (block-open        before after)
       (substatement-open before after)
     )
     (comment-column . 49)
     (fill-column    . 79)
   )
)

  Once done added to following, to your function you have added to
jde-mode-hook.
  (c-set-style "dwfa-java")

  What I have done is create a defun, called javastartup, to set up the
environment they way I am most productive.  Then, I added this to the
java-mode-hook.  This way I let jde to it's stuff and I can do mine.  I
find this to work out very well.  BTW, the above lisp code is in my
javastartup defun.

Douglas WF Acheson

--- Gautam Mani <[EMAIL PROTECTED]> wrote:
> Hi,
> Could you please tell me how to do the same; I tried something like
> 
> (defun my-jde-mode-hook ()
>       (quote (c-set-offset (substatement-open . 0)))
>       )
> 
> (add-hook 'jde-mode-hook 'my-jde-mode-hook)
> 
> but it doesn't seem to work.
> 
> Thanks,
> Gautam
> 
> -- 
> How can you have any pudding if you don't eat your meat?
>               -- Pink Floyd
> 
> 
> 
> > -----Original Message-----
> > From: Paul Kinnucan [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, July 29, 2001 1:32 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: Re: Problem in AutoIndent
> > 
> > 
> > This is a cc-mode problem. cc-mode overrides customized java 
> > indentation
> > settings. The only way to override the default settings is to 
> > override them
> > in your jde-mode hook function. (This may be fixed in the 
> > latest version of
> > cc-mode.)
> > 
> > - Paul
> > 
> > At 12:02 PM 7/28/2001 +0530, Gautam Mani wrote:
> > >Hi,
> > >I am trying to get the following indentation style.
> > >
> > >   if(condition)
> > >   {
> > >           something;
> > >   }
> > >However, the default substatement-open offset is "+" which 
> > means it indents
> > >in the following way
> > >
> > >   if(condition)
> > >           {
> > >                   something;
> > >           }
> > >
> > >An extract of my dot emacs file is:
> > >
> > >(setq default-tab-width 4)
> > >(custom-set-variables
> > > '(c-set-offset (substatement-open . 0))
> > > '(pc-select-meta-moves-sexps t)
> > > '(pc-select-selection-keys-only t)
> > > '(c-echo-syntactic-information-p t)
> > > '(next-line-add-newlines nil)
> > > '(delete-selection-mode t nil (delsel))
> > > '(pc-selection-mode t nil (pc-select)))
> > >
> > >
> > >Even though I explicitly set the c-offset, it is not taking 
> > effect. So, I
> > >have to do a C-x C-o and set
> > >it.
> > >
> > >I realise that this maybe more of an emacs query rather than 
> > JDE, but could
> > >someone
> > >please help me out on this...
> > >
> > >TIA,
> > >Gautam
> > 
> > 


=====
Douglas WF Acheson

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Reply via email to