From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#33247: makefile mode comment color Date: 6 Nov 2018 09:47:21 -0000 Organization: muc.de e.V. Message-ID: <20181106094721.92934.qmail@mail.muc.de> References: <877ehuhls3.fsf@jidanni.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1541498031 21022 195.159.176.226 (6 Nov 2018 09:53:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2018 09:53:51 +0000 (UTC) User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.2-RELEASE-p4 (amd64)) Cc: 33247@debbugs.gnu.org, Stefan Monnier To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 06 10:53:46 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJy3N-0005NL-GO for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Nov 2018 10:53:45 +0100 Original-Received: from localhost ([::1]:39961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJy5U-0001gW-0j for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Nov 2018 04:55:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJy4T-0000p2-3D for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 04:54:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJxxr-0007yn-5B for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 04:48:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJxxp-0007yJ-RC for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 04:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJxxp-00072K-Lu for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 04:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Nov 2018 09:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33247 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33247-submit@debbugs.gnu.org id=B33247.154149764727009 (code B ref 33247); Tue, 06 Nov 2018 09:48:01 +0000 Original-Received: (at 33247) by debbugs.gnu.org; 6 Nov 2018 09:47:27 +0000 Original-Received: from localhost ([127.0.0.1]:35999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJxxG-00071Z-T9 for submit@debbugs.gnu.org; Tue, 06 Nov 2018 04:47:27 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:57172 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gJxxC-00071N-Ok for 33247@debbugs.gnu.org; Tue, 06 Nov 2018 04:47:23 -0500 Original-Received: (qmail 92935 invoked by uid 3782); 6 Nov 2018 09:47:21 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152097 Archived-At: Hello, Dan. In article 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 |, &, ;, <, > (, ), `, \, ", ', , , . : 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).