Hey.
Thanks. man. this damn coding standards. hehehehehe.
On 18-May-2001 Timothy M. Schaeffer wrote:
> c-indent-one-line-block is only meant to turn
>
> if (predicate)
> { do_this(); }
>
> into
>
> if (predicate)
> { do_this(); }
>
> To do what you describe, set the indent for substatement-open to zero.
> c-indent-one-line-block just returns zero if the block is not one line,
> so that will work too. substatement-block-intro will indent the code inside
> the block (the ((tab)) is from my own setup, which contains modifications
> to
> cc-mode. Change it to +, most likely, for your result).
>
>
> (defconst tms-c-style
> '((c-tab-always-indent . t)
> (c-backslash-column . 48)
> (c-basic-offset . ((tab)))
> (c-offsets-alist (
> ...
> (class-close . 0)
> => (inline-open . c-indent-one-line-block)
> (inline-close . 0)
> ...
> (substatement . +)
> (substatement-block-intro . +)
> => (substatement-open . c-indent-one-line-block) ;; or set to zero
> (case-label . 0)
> ...
> (inexpr-statement . 0)
> (inexpr-class . +) )) ))
>
> Tim S
>
> ----- Original Message -----
> From: "Francois Hensley" <cyberdeth@...>
> To: <cc-mode-help@...>; <bug-cc-mode@...>
> Sent: Friday, May 18, 2001 7:59 AM
> Subject: c-indent-one-line-block
>
> ...
>
>> now this works well. except, when i want to code in c, c++, java
> whatever.....
>> i want the code to look like this
>>
>> for(;;)
>> {
>> j++;
>> }
>>
>>
>> at the moment it looks liek this :
>>
>> for(;;)
>> {
>> j++;
>> }
>>
>> how/where do i set .emacs to use c-indent-one-line-block.
>>
> ...
---------------------------------- , ,
,( ).
| \,--_ / |
/_ _ ` /
Francois Hensley /-.,-.` \
Database Administrator | | \ \
._________________________________\O|O | |__.
| ___ ___ ___ ___ (___)`--'_ / |
| | __| _ ___ ___| _ ) __| \ `.______/` / |
| | _| '_/ -_) -_) _ \__ \ |) | `.__, ,/ |
| |_||_| \___\___|___/___/___/ / \ |
|________________________<----.______/ __ \____|
<----|===)))==) \) /=====
Intekom Pty. (Ltd.) <----' `--' `.__,' | _
| | / \
Telephone: +27 11 266-7800 \ _ /`-' \/
Celular: +27 83 438-0173 ,----` \ /
Fax: +27 11 266-7932 \_,-----' \
\________/
The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s).This
information may be subject to attorney and client or other privilege. It
must not be disclosed to any person without Intekom's permission. Please
note that the recipient must scan this e-mail and any attached files for
viruses and the like. Intekom accepts no liability of whatever nature
|