c-indent-continue-inside-parentheses?

c-indent-continue-inside-parentheses?

Post by Era Erikss » Sun, 18 Jun 1995 04:00:00



[I set followup-to comp.emacs because that's what I currently happen
to have first in my .newsrc.el ... anyway, I'd appreciate a private
Cc: too. If somebody comes up with something elaborate and really
constructive I'll summarize to both groups.]

I'm having the terrible feeling that this is one of those things that
can't be changed [easily]:

        for (i = 0;
            i < 128;
        ^^^^  ...

none of the six variables listed under "C mode indentation" seems to
have anything to do with the amount of space inserted in front of a
continued line inside parens.
  What to do? Following question: Will it work in v.18, too?

/* era */

--
See http://www.ling.helsinki.fi/~reriksso/ for mantra, disclaimer, etc.

 
 
 

c-indent-continue-inside-parentheses?

Post by Barry A. Wars » Tue, 20 Jun 1995 04:00:00


    EE> I'm having the terrible feeling that this is one of those
    EE> things that can't be changed [easily]:

Unless you switch to cc-mode, then it *is* easy... :-)

        for (i = 0;
            i < 128;
        ^^^^  ...


    EE> it. That is, none of the six variables listed under "C mode
    EE> indentation" seems to have anything to do with the amount of
    EE> space inserted in front of a continued line inside parens.
    EE> What to do? Following question: Will it work in v.18, too?

cc-mode handles this in two ways.  First, it assigns to that line the
'statement syntax.  Second, it makes the relative buffer position be
the position of the `i' in `i = 0'.  So if you want the second line to
line up under the first (i.e. just after the open paren), then by
default cc-mode will Do The Right Thing.

If you want more control over this, you can always hang a custom
indent function off of 'statement and do whatever special indentation
stuff you want.

[The above may make more sense to you after you read the cc-mode
manual, which will be part of the next release, appearing in a
newsgroup near you very soon].

-Barry

 
 
 

1. tab to spaces + indent - continued

Thanks to everyone who bothered to answer my questions. I still have a
few, though...

I edit my c code in cc-mode.

I managed, using (c-set-offset 'substatement-open 0), to indent the for,
if, etc. statements. I still have a problem when indenting lines like this:

Try
    {
        ....
    }

Where "Try" is a c macro.
How do I tell emacs to keep the braces in the same column as the "Try"?

The second question is about saving tabs as spaces. I'd like to have tabs
when editing the files, but have them saved as spaces. I bound c-mode to
"tabify" and write-file to "untabify", so it was almost solved. I still
have a problem, since this removes all tabs even in not-c files, and
is problematic (especially with makefiles). Can I bind tabify/untabify to
opening/writing files in c-mode only? How?

A more general question - when I tried configuring the offsets, I easily
found the list of parameters I can assign values to. But how do I know
which parameter controls what behavior? Is there a list anywhere? apropos
and info did not help much. Can you learn this, or will it take years
until I finally know what to do :)

Thanks,
Gali

**Please email me off-list if possible, thanks.

-----------------------------------------------------------------------

"This universe is way too fun to have been random..."   -- Jim

2. Trouble with my outbox

3. blink-matching-paren-dont-ignore-comments ignored in fortran mode?

4. PCW8256 vt100 emulato

5. 'indent-for-comment' does not work well with 'comment' inside string.

6. Lucent winmodem connection rate drop problem

7. cc-mode and indenting inside a line

8. Epson GT7000 Help!

9. paren.el enhancement: paren-backwards-message

10. (paren-set-mode 'paren)

11. B,U.I-L,D. -Y,O.U-R` ,O.W-N` ,C.A-B`L,E. -B`O,X. -D`E,S.C-RA`M,B.L-E,R.`,.-`,.,.,.,.,.-`,,,,,,.,.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.-,,,,,,,,,,,,,,,,,,,.,.,.,.,,.,..,...........,,, 2140

12. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8ABPA8AAAAsgQK8AgAAAABBAAAAAoAAEM