]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve makefile-imake-mode
authorPo Lu <luangruo@yahoo.com>
Wed, 12 Oct 2022 12:40:03 +0000 (20:40 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 12 Oct 2022 12:40:24 +0000 (20:40 +0800)
* 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

index cbbcf1c2b7c032af74243ec0d0f84909fa943044..5f265212992686d33e3eafa99fe7a47fb04eac0f 100644 (file)
@@ -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]*"))
 
 \f