summaryrefslogtreecommitdiff
path: root/lisp/progmodes/perl-mode.el
diff options
context:
space:
mode:
authorEvgeni Kolev <evgenysw@gmail.com>2018-03-03 13:07:26 +0200
committerEli Zaretskii <eliz@gnu.org>2018-03-03 13:07:26 +0200
commitf9dfad9358b2af36d1496c525585f761c130f095 (patch)
treed4d094a7ad598d9656e213e851b378b27567feb0 /lisp/progmodes/perl-mode.el
parented071fa79c05e88a2ec3830c0813ed94544854b2 (diff)
downloademacs-f9dfad9358b2af36d1496c525585f761c130f095.tar.gz
Fix font-lock in perl-mode
* 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)
Diffstat (limited to 'lisp/progmodes/perl-mode.el')
-rw-r--r--lisp/progmodes/perl-mode.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 99480788f50..c1d94acfa59 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -165,7 +165,7 @@
;; 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.")