[Top][All Lists]

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

Re: cc-mode: Reverting to the 'dumber' indentation of nested function ca

From: ERDI Gergo
Subject: Re: cc-mode: Reverting to the 'dumber' indentation of nested function calls, as seen in Emacs20
Date: Thu, 13 Nov 2003 20:33:21 +0100 (CET)

On Mon, 10 Nov 2003, ERDI Gergo wrote:

> [Please CC replies to]

> However, with Emacs21, here's what I get (again, '#' denotes double-spaces
> from c-basic-offset. '$' denotes spaces inserted by an unknown smart
> offset-calculator that I wasn't able to hunt down)

1 > ##long_function_name (bar (
2 > $$$$$$$$$$$$$$$$$$$$$$##baz (0)));

so I dug into the sources and the documentation and here's what I got:
the $ part comes from the column 'bar' starts in, in the following way:
when line 2 is inspected, the syntactic analysis returns the position of
the 'b' of 'bar' in line 1. The indentation engine then takes the column
number of that position and uses it as the basis when calculating the
start of line 2.

So what actually happens here is that Emacs20's cc-mode engine got the
start of the expression wrong since it found the beginning 'l' of line 1
to be the start of the expression containing the "baz" call.

However, even now that I know what happens, I still don't know what I
can do about this. I'd still like to make this a special case and make the
indentation of arguments of nested function calls start from the outmost
function call and not the innermost.

Can anyone help me now that we have that more information?


   .--= ULLA! =---------------------.   `We are not here to give users what
   \     \   they want'  -- RMS, at GUADEC 2001
    `---= =---'
Jesus saves, Allah protects, and Buddha enlightens. Cthulhu thinks you taste 
good with ketchup.

reply via email to

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