From: Po Lu Date: Wed, 12 Oct 2022 12:40:03 +0000 (+0800) Subject: Improve makefile-imake-mode X-Git-Tag: emacs-29.0.90~1616^2~650 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1e961eda7275802f88d855fccf097b4081d21b18;p=emacs.git 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. --- 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]*"))