Re: [cmake-developers] Code style auto-formatting
On 05/09/2016 03:29 PM, Paul Smith wrote: > On Mon, 2016-05-09 at 14:17 -0400, Brad King wrote: >>> Where does 79 come from? >> >> That has been CMake's limit for a long time. Since we're changing the >> style anyway we might as well go with the more common 80 chars > > Not to say whether or not this should be changed, but FYI the 79 comes > from this set of facts: > > * Traditional terminals are 80 chars wide > * Editors and viewers that do line-wrapping use the last character of >the line to specify whether there was a wrap, otherwise you can't >tell if the line is wrapped or there's a newline. Thanks, Paul. Good explanation of the historical reason. I tend to agree, but I wonder why this has not caused any of the standard styles clang-format provides (Mozilla, Google, LLVM, etc.) to adopt 79 characters instead of 80. Maybe it is just that the width limit is now more about supporting side-by-side diff views or multiple terminal splits without using the entire monitor width for viewing a source file with long lines. It also helps avoid excessive eye movement horizontally while reading code. The difference between 79 and 80 characters for these purposes is negligible. Only a small fraction of lines should end up near this limit so I do not think readability will change much between 79 and 80 chars. Therefore I propose that we go back to 79 characters for the above reasons. It will also help `git diff` views fit in 80 chars even with the left `+/-` column. This brings us to: --- # This configuration requires clang-format 3.8 or higher. BasedOnStyle: Mozilla AlignOperands: false AlwaysBreakAfterReturnType: None AlwaysBreakAfterDefinitionReturnType: None ColumnLimit: 79 Standard: Cpp03 ... -Brad -- 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-developers
Re: [cmake-developers] cmake-mode.el: Make cmake-tab-width a customizable variable
On 05/10/2016 10:54 AM, Taylor Braun-Jones wrote: > This is a minor usability improvement that allows easily setting the > indentation width for cmake-mode (and making the variable buffer-specific > using make-local-variable). Useful when working with CMake code from code > bases that use different indentation standards. Thanks, applied: cmake-mode.el: Make cmake-tab-width a customizable variable https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f12b899f -Brad -- 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-developers
[cmake-developers] cmake-mode.el: Make cmake-tab-width a customizable variable
This is a minor usability improvement that allows easily setting the indentation width for cmake-mode (and making the variable buffer-specific using make-local-variable). Useful when working with CMake code from code bases that use different indentation standards. Taylor From f460bdfa6a01cdb1cd76d61eadcd1bf85d8c84c3 Mon Sep 17 00:00:00 2001 From: Taylor Braun-JonesDate: Tue, 10 May 2016 10:34:16 -0400 Subject: [PATCH] cmake-mode.el: Make cmake-tab-width a customizable variable --- Auxiliary/cmake-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index d74dba0..20def8b 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -228,7 +228,9 @@ the indentation. Otherwise it retains the same position on the line" ;; ;; Indentation increment. ;; -(defvar cmake-tab-width 2) +(defcustom cmake-tab-width 2 + "Number of columns to indent cmake blocks" + :type 'integer) ;-- -- 2.7.4 -- 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-developers
[cmake-developers] [CMake 0016098]: CMake fails to read its own cache after writing a variable with a carriage return.
The following issue has been SUBMITTED. == https://public.kitware.com/Bug/view.php?id=16098 == Reported By:tibur Assigned To: == Project:CMake Issue ID: 16098 Category: CMake Reproducibility:always Severity: minor Priority: normal Status: new == Date Submitted: 2016-05-10 10:41 EDT Last Modified: 2016-05-10 10:41 EDT == Summary:CMake fails to read its own cache after writing a variable with a carriage return. Description: I let cmake read a version number from a file, and then store a variable made from this version number string. {{{ cmake_minimum_required(VERSION 2.8.9) file(READ "version.txt" API_VERSION) string(REPLACE "." ";" API_VERSION_LIST ${API_VERSION}) list(GET API_VERSION_LIST 0 API_VERSION_MAJOR) list(GET API_VERSION_LIST 1 API_VERSION_MINOR) list(GET API_VERSION_LIST 2 API_VERSION_PATCH) #string(STRIP ${API_VERSION_PATCH} API_VERSION_PATCH) set(TEST "${API_VERSION_PATCH}_TEST" CACHE STRING "Offending entry") }}} If the version.txt file contains a newline at the end, then the corresponding variable is broken within cmake cache. CMake then complains: CMake Error: Parse error in cache file [...]/cmake_bug/build/CMakeCache.txt. Offending entry: _TEST If we look at CMakeCache.txt we can see the following lines: TEST:STRING=4 _TEST Steps to Reproduce: Get both files. Use cmake first to create the build directory, then a second time on that build folder. == Issue History Date ModifiedUsername FieldChange == 2016-05-10 10:41 tibur New Issue 2016-05-10 10:41 tibur File Added: version.txt == -- 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-developers
[cmake-developers] [CMake 0016099]: cmake and cmake-gui don
The following issue has been SUBMITTED. == https://cmake.org/Bug/view.php?id=16099 == Reported By:Stefan Zink Assigned To: == Project:CMake Issue ID: 16099 Category: CMake Reproducibility:always Severity: major Priority: normal Status: new == Date Submitted: 2016-05-10 10:45 EDT Last Modified: 2016-05-10 10:45 EDT == Summary:cmake and cmake-gui don Description: cmake-gui: 3.5 !> 3.0 3.5 > 3.0 Configuring done cmake: 3.5 > 3.0 3.5 > 3.0 -- Configuring done == Issue History Date ModifiedUsername FieldChange == 2016-05-10 10:45 Stefan ZinkNew Issue 2016-05-10 10:45 Stefan ZinkFile Added: CMakeLists.txt == -- 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-developers