From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#23266: 25.0.92; GNUmakefile mode incorrect syntax highlighting Date: Mon, 11 Apr 2016 14:47:30 +0200 Message-ID: References: <87potxgj8p.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c122d289b1e11053034f2dc X-Trace: ger.gmane.org 1460378900 30199 80.91.229.3 (11 Apr 2016 12:48:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Apr 2016 12:48:20 +0000 (UTC) To: 23266@debbugs.gnu.org, Dima Kogan , Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 11 14:48:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1apbGH-0004wE-7v for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Apr 2016 14:48:13 +0200 Original-Received: from localhost ([::1]:54314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apbGG-00040M-Iq for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Apr 2016 08:48:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apbGA-0003xG-U3 for bug-gnu-emacs@gnu.org; Mon, 11 Apr 2016 08:48:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apbG6-0003Ib-PI for bug-gnu-emacs@gnu.org; Mon, 11 Apr 2016 08:48:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apbG6-0003IX-L6 for bug-gnu-emacs@gnu.org; Mon, 11 Apr 2016 08:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1apbG6-0004v7-Gh for bug-gnu-emacs@gnu.org; Mon, 11 Apr 2016 08:48:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87potxgj8p.fsf@secretsauce.net> Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Apr 2016 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23266 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23266-submit@debbugs.gnu.org id=B23266.146037885718882 (code B ref 23266); Mon, 11 Apr 2016 12:48:02 +0000 Original-Received: (at 23266) by debbugs.gnu.org; 11 Apr 2016 12:47:37 +0000 Original-Received: from localhost ([127.0.0.1]:58137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apbFh-0004uU-A7 for submit@debbugs.gnu.org; Mon, 11 Apr 2016 08:47:37 -0400 Original-Received: from mail-vk0-f53.google.com ([209.85.213.53]:36477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apbFg-0004uH-48 for 23266@debbugs.gnu.org; Mon, 11 Apr 2016 08:47:36 -0400 Original-Received: by mail-vk0-f53.google.com with SMTP id c4so210560715vkb.3 for <23266@debbugs.gnu.org>; Mon, 11 Apr 2016 05:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=XHbICkQS8vtdth5i3z73W82wvUIKAxsCJNY2CjCehoU=; b=ukEwyLS7AD9ClNTVmrAkyYfjd11YSPNUUCSGdyNdghaPQ1sFBhdgzRzCjfM7I8q0GE bZTb9vm7k4QcuFQmodH9TMYD3eB9Nzd1uvkhEHuPuX2tA7OMmjMx3VGLgve+wVaGFYos PC2wOTojYSHBzmSTtBgtuErcAsqFDWP0ifoO4AVUh2zxq14SshZPbHrBBV1NoBKmkp0H P0REzJ+NgW0ooTFxTL4f4xCToGyQ1PeTBRODCedFH1I2jmaVsxwNda8TPwWGWhcGgR7m O5CuP6ZH+30O0nuH9li05QKKCG80ZK/kCyytipV08jEwV3ZtVn6rk0UrE1RJiU7l3D1K V2ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=XHbICkQS8vtdth5i3z73W82wvUIKAxsCJNY2CjCehoU=; b=IZdtXk/V8/lFSQBrNpd7PxkAdubxBY12iXw10ZFRC2MfchFvuoRZCSzSbA3USfIwgV hlHI7wdWmnZyo134ALwIGeUZ+aolypXvrSAlJ+WkuGuXm8rq/UxTnu3PGrB3iUG6BRZH v6KA/g3C8KYTTDqdaW9I81ly6bvTICTcD0ZydGdnV+FgGnf7CCHOPqjk5cU7yEFsnUG8 PykyZmNLuyGmz1KR6dsFg01x2Q6pcCtBQkyKnM8oHFjcn1++6shmS1rf6UftqSg8dIe6 malvKr40W1S1qqfH2TNYnNnhg/CkkZT7/ke7wXZ06BzTmontwYUD6iMMiEvjQGTrdps1 +lWg== X-Gm-Message-State: AD7BkJK9yim9mt1586L7oUnDTQNOxkW+lKrPz0XpPfrfNL601tl0NAqyJzGbt1cXlQfxjLrM6VqzaihSz66M0Q== X-Received: by 10.176.6.130 with SMTP id g2mr11335702uag.58.1460378850235; Mon, 11 Apr 2016 05:47:30 -0700 (PDT) Original-Received: by 10.31.214.131 with HTTP; Mon, 11 Apr 2016 05:47:30 -0700 (PDT) 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:116377 Archived-At: --94eb2c122d289b1e11053034f2dc Content-Type: text/plain; charset=UTF-8 Hi! I think it's the following font-lock keyword that is broken: ("[^$]\\$[({]\\([-a-zA-Z0-9_.]+\\|[@%
Hi!

I think it's the followin= g font-lock keyword that is broken:

=C2=A0 =C2=A0 ("[^$]\\$[({]= \\([-a-zA-Z0-9_.]+\\|[@%<?^+*][FD]?\\)"
=C2=A0 =C2=A0 =C2=A0 (1 = font-lock-variable-name-face prepend))

The regexp match = constructs like $(NAME). However, in an attempt not to match $$(NAME), it t= ries to match any other character besides $ before $(NAME). When $(NAME) is= at the beginning of a line, at the beginning of the search, this fails.

The reason why the buffer originally is colored corr= ectly is that the [^$] match the newline of the previous line. However, aft= er an edit, font-lock only highlights the edited parts. When the search res= umes on a line starting with $(NAME), the regexp no longer match.

You can verify this in Font-Lock Studio (https://github.com/Lindydancer/fo= nt-lock-studio) by first single-stepping (SPC) the rule in the whole bu= ffer, then mark a single line and step only that line, using `font-lock-stu= dio' and `font-lock-studio-region', respectively.

This can be fixed in a number of ways:

=C2= =A0* Replace "[^$]" with "\\(^\\|[^$]\\)", which mean t= o match the beginning of a line or any non-$ character.

=C2=A0* Implement the search in a function that would search for the = regex (except the "[^$]" part) plus code to check that it's n= ot preceded by a "$".

=C2=A0* Extend the= region that should be highlighted to include all lines that end with the &= quot;\" character. This can be done by adding a mode-specific function= to `font-lock-extend-region-functions'.

Note = that there seems to be six rules in Makefile mode using this pattern, I gue= ss all of them needs to be fixes.

=C2=A0 =C2=A0 --= Anders Lindgren

--94eb2c122d289b1e11053034f2dc--