all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* newbie help with emacs C style
@ 2003-05-01  0:51 Bret Comstock Waldow
  2003-05-01  8:22 ` John McCabe
  2003-05-01 12:04 ` Kai Großjohann
  0 siblings, 2 replies; 4+ messages in thread
From: Bret Comstock Waldow @ 2003-05-01  0:51 UTC (permalink / raw)


I would like to format my C (and C++ and Java) code like this:

function (arguments)
	{
	statement;
	statement;

	if ( something is true )
		{
		statement;
		statement;
		}

	statement;
	}

The names listed in the documentation I've read so far don't make sense to
me - there's not enough of a description of what corresponds to what for
me to pick out which variable I need to set...I think I'm supposed to set
it to "+" to get it to indent - is this right?

Can someone provide the name of the variable that controls the brace and
statement indenting shown above?  Whenever I open a new level of inner
brace on a new line, I want the braces and code to indent the same amount.

Also, can someone tell me where there's a reference that shows what the
#@$^%# names like:

 "'defun-block-intro' In the first line in a top-level defun."

correspond to?  I wouldn't know where to find the definition of a
"top-level defun" - where do you learn such a thing?

I think "defun" means "define function", but I can't figure out why it's
not called a "function definition".  Where do people call them defuns? 
What distinguishes a "top-level" one from whatever else there is?  I'm
aware of nested blocks in C, but I don't know of nested functions...

It's a bit much to bite off all by oneself at first.  Thanks for any help.

Cheers,
Bret

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: newbie help with emacs C style
  2003-05-01  0:51 newbie help with emacs C style Bret Comstock Waldow
@ 2003-05-01  8:22 ` John McCabe
  2003-05-01 13:31   ` Bret Comstock Waldow
  2003-05-01 12:04 ` Kai Großjohann
  1 sibling, 1 reply; 4+ messages in thread
From: John McCabe @ 2003-05-01  8:22 UTC (permalink / raw)


On Thu, 01 May 2003 00:51:03 GMT, "Bret Comstock Waldow"
<bcw1000@hotmail.com> wrote:

>I would like to format my C (and C++ and Java) code like this:
>
>function (arguments)
>	{
>	statement;
>	statement;
>
>	if ( something is true )
>		{
>		statement;
>		statement;
>		}
>
>	statement;
>	}

Seriously?

Best Regards
John McCabe

To reply by email replace 'nospam' with 'assen'

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: newbie help with emacs C style
  2003-05-01  0:51 newbie help with emacs C style Bret Comstock Waldow
  2003-05-01  8:22 ` John McCabe
@ 2003-05-01 12:04 ` Kai Großjohann
  1 sibling, 0 replies; 4+ messages in thread
From: Kai Großjohann @ 2003-05-01 12:04 UTC (permalink / raw)


"Bret Comstock Waldow" <bcw1000@hotmail.com> writes:

> I would like to format my C (and C++ and Java) code like this:

Have you read the CC mode info file, yet?  It contains information on
configuring indentation.

The first thing to do is to select a style which does this.  When you
look for a style, don't look for the indentation offset too much.  So
if you find something that looks like what you want, except that
lines are indented 2 spaces instead of 8, choose that style, then
configure c-basic-offset to 8.

-- 
file-error; Data: (Opening input file no such file or directory ~/.signature)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: newbie help with emacs C style
  2003-05-01  8:22 ` John McCabe
@ 2003-05-01 13:31   ` Bret Comstock Waldow
  0 siblings, 0 replies; 4+ messages in thread
From: Bret Comstock Waldow @ 2003-05-01 13:31 UTC (permalink / raw)


<grin> Yes, seriously.  Perhaps it's indicative of some learning
disability or such, but I find it much easier to understand code I'm
working on when it's formatted this way.  Visually "busy", "dense" pages
are hard for me to skip into.

I read very fast, over a thousand words a minute, so I'm not reading
linearly - I read down the page at a glance.

<shrug> It works for me.

Cheers,
Bret

On Thu, 01 May 2003 08:22:35 +0000, John McCabe wrote:

> On Thu, 01 May 2003 00:51:03 GMT, "Bret Comstock Waldow"
> <bcw1000@hotmail.com> wrote:
> 
>>I would like to format my C (and C++ and Java) code like this:
>>
>>function (arguments)
>>	{
>>	statement;
>>	statement;
> 
> Seriously?
> 
> Best Regards
> John McCabe
> 
> To reply by email replace 'nospam' with 'assen'

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-05-01 13:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-01  0:51 newbie help with emacs C style Bret Comstock Waldow
2003-05-01  8:22 ` John McCabe
2003-05-01 13:31   ` Bret Comstock Waldow
2003-05-01 12:04 ` Kai Großjohann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.