all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>
Cc: 33247@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#33247: makefile mode comment color
Date: 6 Nov 2018 09:47:21 -0000	[thread overview]
Message-ID: <20181106094721.92934.qmail@mail.muc.de> (raw)
In-Reply-To: <mailman.3320.1541216477.1284.bug-gnu-emacs@gnu.org>

Hello, Dan.

In article <mailman.3320.1541216477.1284.bug-gnu-emacs@gnu.org> 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).






  parent reply	other threads:[~2018-11-06  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-03  3:39 bug#33247: makefile mode comment color 積丹尼 Dan Jacobson
     [not found] ` <mailman.3320.1541216477.1284.bug-gnu-emacs@gnu.org>
2018-11-06  9:47   ` Alan Mackenzie [this message]
2018-11-06 13:25     ` Stefan Monnier
2018-11-06 10:01 ` 積丹尼 Dan Jacobson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181106094721.92934.qmail@mail.muc.de \
    --to=acm@muc.de \
    --cc=33247@debbugs.gnu.org \
    --cc=jidanni@jidanni.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.