From 1e961eda7275802f88d855fccf097b4081d21b18 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 12 Oct 2022 20:40:03 +0800 Subject: [PATCH] Improve makefile-imake-mode * lisp/progmodes/make-mode.el (makefile-imake-font-lock-keywords): Give Imake priority over CPP keywords, and don't require comments to start at BOL. (makefile-imake-mode): Set comment-start to some sensible value. --- lisp/progmodes/make-mode.el | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index cbbcf1c2b7c..5f265212992 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -488,17 +488,12 @@ not be enclosed in { } or ( )." (defconst makefile-imake-font-lock-keywords - (append - (makefile-make-font-lock-keywords - makefile-var-use-regex - makefile-statements - t - nil - '("^XCOMM.*$" . font-lock-comment-face) - '("XVAR\\(?:use\\|def\\)[0-9]" 0 font-lock-keyword-face prepend) - '("@@" . font-lock-preprocessor-face) - ) - cpp-font-lock-keywords)) + (append (list '("XCOMM.*$" . font-lock-comment-face) + '("XVAR\\(?:use\\|def\\)[0-9]" 0 + font-lock-keyword-face prepend) + '("@@" . font-lock-preprocessor-face)) + cpp-font-lock-keywords + makefile-font-lock-keywords)) (defconst makefile-syntax-propertize-function @@ -932,7 +927,9 @@ Makefile mode can be configured by modifying the following variables: :syntax-table makefile-imake-mode-syntax-table (setq-local syntax-propertize-function nil) (setq font-lock-defaults - `(makefile-imake-font-lock-keywords ,@(cdr font-lock-defaults)))) + `(makefile-imake-font-lock-keywords ,@(cdr font-lock-defaults))) + (setq-local comment-start "XCOMM") + (setq-local comment-start-skip "XCOMM[ \t]*")) -- 2.39.5