]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix font-lock in perl-mode
authorEvgeni Kolev <evgenysw@gmail.com>
Sat, 3 Mar 2018 11:07:26 +0000 (13:07 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 3 Mar 2018 11:07:26 +0000 (13:07 +0200)
* lisp/progmodes/perl-mode.el (perl-font-lock-keywords-1): Prevent
the regexp from matching keywords if they start with a Perl sigil.
(Bug#30549)

lisp/progmodes/perl-mode.el

index 99480788f50f98c3ffee463d92fb19fe2ea82a4c..c1d94acfa59648c72b0d217e2af4223c9059503d 100644 (file)
     ;; Fontify function and package names in declarations.
     ("\\<\\(package\\|sub\\)\\>[ \t]*\\(\\sw+\\)?"
      (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t))
-    ("\\<\\(import\\|no\\|require\\|use\\)\\>[ \t]*\\(\\sw+\\)?"
+    ("\\(^\\|[^$@%&\\]\\)\\<\\(import\\|no\\|require\\|use\\)\\>[ \t]*\\(\\sw+\\)?"
      (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)))
   "Subdued level highlighting for Perl mode.")