help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

continuing indentation in for loop condition in cc-mode


From: Gregory Fong
Subject: continuing indentation in for loop condition in cc-mode
Date: Fri, 5 Feb 2016 17:24:31 -0800

Hello all,

I was trying to figure out how to adjust indentation in a for loop in
emacs like so:

for (int i = 0;
  i < 5;
  ++i)
{
}

but I can't seem to find an offset that adjusts this parameter.
c-show-syntatic information just shows these as being a statement.

Emacs will default to align with the first item in the condition:

for (int i = 0;
     i < 5;
     ++i)
{
}

I can't imagine that I'm the only person who has tried to change this,
but it's surprisingly difficult to search for answers.  The closest
thing to a solution I've found is
https://lists.gnu.org/archive/html/help-gnu-emacs/2008-02/msg00791.html
, but it doesn't seem to change anything and I'm a bit out of my depth
trying to debug it.

If anyone has any thoughts on how to change the indentation to match
the style above, would very much appreciate the help :-).  Any
starting point would be good, I'm just not sure where to go beyond
modifying items in the c-offsets-alist.

Thanks and regards,
Gregory



reply via email to

[Prev in Thread] Current Thread [Next in Thread]