bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33247: makefile mode comment color


From: Alan Mackenzie
Subject: bug#33247: makefile mode comment color
Date: 6 Nov 2018 09:47:21 -0000
User-agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.2-RELEASE-p4 (amd64))

Hello, Dan.

In article <address@hidden> you wrote:
> Makefile-mode should show comment color for both of
> xxx:# yyyy
> xxx: #zzzz
> not just the last.

Yes.  In make-mode.el, at line 525, there's a syntax-propertize-function
setting which decommentises a # unless the previous character was one of
|, &, ;, <, > (, ), `, \, ", ', <space>, <tab>, <newline>.  : is not in
that list.

The comment to this setting:

   ;; From sh-script.el.
   ;; A `#' begins a comment in sh when it is unquoted and at the beginning
   ;; of a word.  In the shell, words are separated by metacharacters.
   ;; The list of special chars is taken from the single-unix spec of the
   ;; shell command language (under `quoting') but with `$' removed.

confirms that the setting was taken over from shell-script-mode, and it
is essentially unchanged.

Why do we have this setting for makefiles at all?  Are there any such
restrictions on comments in Makefiles?  Stefan?

As a quick fix, please try the following (based off of master, though
it'll probably work on released versions, too):


diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index f67407f48e..27da624086 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -522,7 +522,7 @@ makefile-syntax-propertize-function
    ;; of a word.  In the shell, words are separated by metacharacters.
    ;; The list of special chars is taken from the single-unix spec of the
    ;; shell command language (under `quoting') but with `$' removed.
-   ("[^|&;<>()`\\\"' \t\n]\\(#+\\)" (1 "_"))
+   ;; ("[^|&;<>()`\\\"' \t\n]\\(#+\\)" (1 "_"))
    ;; Change the syntax of a quoted newline so that it does not end a comment.
    ("\\\\\n" (0 "."))))
 


-- 
Alan Mackenzie (Nuremberg, Germany).






reply via email to

[Prev in Thread] Current Thread [Next in Thread]