So, what do you suggest we should do now? :) My suggestion would be to update the Emacs/Vim modes and have them as "standard", and sometime later maybe formalize it?
All except I think 2 code snippets here use my suggested codestyle: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html
Is the indentation scheme formally defined somewhere? If no, we could also do that when addressing this.
Of course, my proposal leaves this indentation variant untouched:
FancyFunction(NAME just
OPTION testing)
It seems that the current style of writing CMake hanging braces is this:
FancyFunction(
NAME just
OPTION testing
)
I propose it should rather be:
FancyFunction(
NAME just
OPTION testing
)
Thinking the former variant was a bug, I had opened a MR !6317 fixing this indentation in Emacs
Suppose you have this function call:
FancyFunction(
NAME just
OPTION testing
) # this parens should be at previous indent level
With this patch, the indentation will be
FancyFunction(
NAME just
OPTION testing
) # now it's correct
Multiple closing parens won't decrease indentation more, but the current cmake syntax doesn't allow nesting function calls anyway.
Jonas Jelten (cf29eae8) at 07 Jul 09:38
cmake-mode.el: dedent a hanging parens