summaryrefslogtreecommitdiff
path: root/lisp/progmodes/perl-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-04-02 20:41:09 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-04-02 20:41:09 -0400
commit062e286b7ccf2b23cfafef1bf1128eaf91e0ec94 (patch)
treeae8c241903261aca39d953c8b3399a72fbc71d79 /lisp/progmodes/perl-mode.el
parent8a7fd442120979132a5c7beb0ac910ea3fae165d (diff)
downloademacs-062e286b7ccf2b23cfafef1bf1128eaf91e0ec94.tar.gz
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $'
used as a variable. Fixes: debbugs:17174
Diffstat (limited to 'lisp/progmodes/perl-mode.el')
-rw-r--r--lisp/progmodes/perl-mode.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index cf9347d0e6d..3486c0a1983 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -250,7 +250,11 @@
;; Catch ${ so that ${var} doesn't screw up indentation.
;; This also catches $' to handle 'foo$', although it should really
;; check that it occurs inside a '..' string.
- ("\\(\\$\\)[{']" (1 ". p"))
+ ("\\(\\$\\)[{']" (1 (unless (and (eq ?\' (char-after (match-end 1)))
+ (save-excursion
+ (not (nth 3 (syntax-ppss
+ (match-beginning 0))))))
+ (string-to-syntax ". p"))))
;; Handle funny names like $DB'stop.
("\\$ ?{?^?[_[:alpha:]][_[:alnum:]]*\\('\\)[_[:alpha:]]" (1 "_"))
;; format statements