Files named CMakeLists.txt are correctly assigned a CMakeLexer if you use
get_lexer_for_filename. They are incorrectly assigned a TextLexer if you use
In : guess_lexer_for_filename('CMakeLists.txt','') Out: <pygments.lexers.TextLexer> In : get_lexer_for_filename('CMakeLists.txt') Out: <pygments.lexers.CMakeLexer>
CMakeLists.txt is a more specific name than
*.txt it seems to me that both functions should return a CMakeLexer.