[cmake-developers] syntax of '_' should be treated as symbol

Syohei YOSHIDA syohex at gmail.com
Wed Nov 12 02:17:07 EST 2014


Word commands, such as foward-word(M-f), backward-kill-word(M-backspace),
don't work well like other major-modes if syntax of '_' is treated as "word".
---
 Auxiliary/cmake-mode.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index c8b9f8b..f1470f3 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -202,7 +202,7 @@ the indentation.  Otherwise it retains the same position on the line"
 ;; Keyword highlighting regex-to-face map.
 ;;
 (defconst cmake-font-lock-keywords
-  (list '("^[ \t]*\\(\\w+\\)[ \t]*(" 1 font-lock-function-name-face))
+  (list '("^[ \t]*\\([[:word:]_]+\\)[ \t]*(" 1 font-lock-function-name-face))
   "Highlighting expressions for CMAKE mode."
   )
 
@@ -241,7 +241,6 @@ the indentation.  Otherwise it retains the same position on the line"
   ; Create the syntax table
   (setq cmake-mode-syntax-table (make-syntax-table))
   (set-syntax-table cmake-mode-syntax-table)
-  (modify-syntax-entry ?_  "w" cmake-mode-syntax-table)
   (modify-syntax-entry ?\(  "()" cmake-mode-syntax-table)
   (modify-syntax-entry ?\)  ")(" cmake-mode-syntax-table)
   (modify-syntax-entry ?# "<" cmake-mode-syntax-table)
-- 
2.1.0



More information about the cmake-developers mailing list