Click to See Complete Forum and Search --> : Emacs and indentation


Salmon
07-20-2001, 11:44 AM
I'm having some problems with the a php mode for emacs. Most of it is derived from c-mode.

According to the PEAR standard, functions definitions should be formatted like this . . .


function myFunction($arg1)
{
// function code
}


That's not a problem. Not unless the function is actually a method (function definition embedded within a class), in which case the mode decides that the indentation should look like this . . .

function myMethod($arg1)
{
//function code
}


I'm sure that I can probably just change a c-mode setting to fix this. I just don't know which one.

Thanks for any help.

[ 20 July 2001: Message edited by: Salmon ]

Qubit
07-20-2001, 01:21 PM
(c-set-style "k&r")

Apart from k&r you can also specify bsd, which basically does the same thing, except bsd takes a tab to be 4 spaces whereas k&r says it's 8.

There are some other C modes, but I don't know about them.

Salmon
07-20-2001, 01:48 PM
c-set-style "k&r")

Thanks, but I'm already using k&r. That works fine unless I have the function definition within a class definition, which produces the indentation provided above.

Whipping Boy
07-23-2001, 12:32 AM
Why are you using Emacs?

:cool:vim :cool: