MantisBT - CMake
View Issue Details
0012995CMakeDocumentationpublic2012-02-23 21:362012-09-03 16:02
Christopher Sean Morrison 
Brad King 
normaltweakalways
closedfixed 
 
CMake 2.8.8CMake 2.8.8 
0012995: Emacs case-insensitive indentation in cmake-mode
The cmake-mode.el Emacs mode would incorrectly indent cmake sources if they were written in lower-case. Attached is a patch that makes the mode case-insensitive so that it will indent correctly regardless of case used. This makes the emacs mode match cmake's own internal (case-insensitive) logic parsing.
"M-x indent-region" on a .cmake source file or CMakeLists.txt file that writes uses lowercase instead of uppercase for the syntax. Example:

macro(BAD_INDENT)
  if(some_condition)
    set(foo "bar")
  else(some_condition)
    set(bar "foo")
  endif(some_condition)
endmacro(BAD_INDENT)
No tags attached.
patch cmake-mode-case.patch (993) 2012-02-23 21:36
https://public.kitware.com/Bug/file/4233/cmake-mode-case.patch
Issue History
2012-02-23 21:36Christopher Sean MorrisonNew Issue
2012-02-23 21:36Christopher Sean MorrisonFile Added: cmake-mode-case.patch
2012-02-24 10:44Brad KingNote Added: 0028713
2012-02-24 10:45Brad KingAssigned To => Brad King
2012-02-24 10:45Brad KingStatusnew => assigned
2012-02-24 13:19Christopher Sean MorrisonNote Added: 0028715
2012-02-24 13:26Brad KingNote Added: 0028717
2012-02-24 13:26Brad KingStatusassigned => resolved
2012-02-24 13:26Brad KingFixed in Version => CMake 2.8.8
2012-02-24 13:26Brad KingResolutionopen => fixed
2012-04-19 15:51David ColeTarget Version => CMake 2.8.8
2012-09-03 16:02David ColeNote Added: 0030882
2012-09-03 16:02David ColeStatusresolved => closed

Notes
(0028713)
Brad King   
2012-02-24 10:44   
Strange. The indentation works for me without this patch. What determines whether string-match is sensitive to case?
(0028715)
Christopher Sean Morrison   
2012-02-24 13:19   
The indentation works for me as well .. on some Emacs invocations, but not on others. When I investigated, it was case-sensitivity. I didn't determine whether the cause was due to different versions of Emacs, different platforms, or even different file content, but it was definitely an issue. One thread I read seemed to suggest that string-match uses some sort of heuristic to determine whether it should run case-sensitive or not. The patch makes the underlying cause moot since it makes the regex itself insensitive.
(0028717)
Brad King   
2012-02-24 13:26   
Thanks for the explanation. Applied:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab9824e1 [^]
(0030882)
David Cole   
2012-09-03 16:02   
Closing resolved issues that have not been updated in more than 4 months.