From 758664b7ad018aa19072fe5c359a702c472faae2 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 13 Aug 2015 10:23:34 -0500 Subject: [PATCH 1/2] cmake-mode.el: Fix function name font-lock Allow space separating name and opening parenthesis. --- Auxiliary/cmake-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index 02f03855f..cf82d0971 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -198,7 +198,7 @@ the indentation. Otherwise it retains the same position on the line" ,@(mapcar #'downcase cmake-keywords)) symbol-end)) . font-lock-keyword-face) - (,(rx symbol-start (group (+ (or word (syntax symbol)))) ?\() + (,(rx symbol-start (group (+ (or word (syntax symbol)))) (* blank) ?\() 1 font-lock-function-name-face) ("\\${?\\([[:alpha:]_][[:alnum:]_]*\\|[0-9]+\\|[$*_]\\)" 1 font-lock-variable-name-face t) From 64e6bc5ca3bf15239829f18a71511df2f04181b3 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 13 Aug 2015 10:54:27 -0500 Subject: [PATCH 2/2] cmake-mode.el: Refine variable font-lock Simplify regexp for variable names, and allow more legal characters. Remove `$ *` as legal chars, and allow `- + / .` in names. --- Auxiliary/cmake-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index cf82d0971..11e33b378 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -200,7 +200,7 @@ the indentation. Otherwise it retains the same position on the line" . font-lock-keyword-face) (,(rx symbol-start (group (+ (or word (syntax symbol)))) (* blank) ?\() 1 font-lock-function-name-face) - ("\\${?\\([[:alpha:]_][[:alnum:]_]*\\|[0-9]+\\|[$*_]\\)" + (,(rx "${" (group (+(any alnum "-_+/."))) "}") 1 font-lock-variable-name-face t) ) "Highlighting expressions for CMake mode.")