Emacs cmake-mode indentation flaw

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Emacs cmake-mode indentation flaw

Frank Roland

There is probably a faulty indentation implemented in cmake-mode for emacs regarding closing parens.

If you have the following source code:

foo(
   bar
)


I indents the closing parenwould expect it to be indented like this:

foo(
   bar
   )


I would expect the single closing paren to be not indendet.


Can anybody confirm that this is an issue worth reporting?


I could also create a pull request for a fix if there is interest in doing so.



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Emacs cmake-mode indentation flaw

Chuck Atkins
Hi Frank,
It's really a matter of personal style.  There's a multitude of different ways that people format multi-line function calls so no one way is right or wrong.  For instance:

foo(
  bar1
  bar2)

foo(
  bar1
  bar2
  )

foo(
  bar1
  bar2
)

foo(bar1
    bar2)

foo(bar1
    bar2

)


foo(bar1

    bar2

    )


All of which have their justifications.

----------
Chuck Atkins
Staff R&D Engineer, Scientific Computing
Kitware, Inc.


On Fri, Jun 2, 2017 at 1:57 AM, Frank Roland <[hidden email]> wrote:

There is probably a faulty indentation implemented in cmake-mode for emacs regarding closing parens.

If you have the following source code:

foo(
   bar
)


I indents the closing parenwould expect it to be indented like this:

foo(
   bar
   )


I would expect the single closing paren to be not indendet.


Can anybody confirm that this is an issue worth reporting?


I could also create a pull request for a fix if there is interest in doing so.



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Emacs cmake-mode indentation flaw

Sergey Zakharchenko

Hi Chuck, Frank,

> On Fri, Jun 2, 2017 at 1:57 AM, Frank Roland <[hidden email]> wrote:
>> I indents the closing paren would expect it to be indented like this:
>> foo(
>>    bar
>>    )
>> I would expect the single closing paren to be not indendet.
> It's really a matter of personal style.  There's a multitude of different ways that people format multi-line function calls so no one way is right or wrong. 

That's true and I know much CMake code is written in the style which matches the current cmake-mode behaviour, but it would be awesome if it could be configurable; I'd certainly be willing to help test/debug this (my preferences match Frank's).

Best regards,

--
DoubleF


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Loading...