Subject: bug#37934: makefile colors messed up by ://

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 30 Oct 2019 12:12:00 +0100

積丹尼 Dan Jacobson <[email-masked]> writes:

> $ cat makefile
> x:
> 	echo This line is the correct color.
> 	echo This line is not. Because it contains the string file:// in it.

I can confirm that this bug is still in Emacs.  The problem is this regexp:

(defvar makefile-dependency-regex
  ;; Allow for two nested levels $(v1:$(v2:$(v3:a=b)=c)=d)
  "^\\(\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[({]\\(?:\\$\\(?:[^({]\\|.[^\n$#})]+?[})]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#)}]\\)+?[})]\\|[^({]\\)\\|[^\n$#:=]\\)+?\\)\\(:\\)\\(?:[ \t]*$\\|[^=\n]\\(?:[^#\n]*?;[ \t]*\\(.+\\)\\)?\\)"
  "Regex used to find dependency lines in a makefile.")

Of which I can only say...  "eek".

I wonder -- has anybody considered rewriting make-mode.el using
syntax-ppss?  Or is the syntax just too intractable for that?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no