From 062e286b7ccf2b23cfafef1bf1128eaf91e0ec94 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 2 Apr 2014 20:41:09 -0400 Subject: [PATCH] * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $' used as a variable. Fixes: debbugs:17174 --- lisp/ChangeLog | 5 +++++ lisp/progmodes/perl-mode.el | 6 +++++- src/ChangeLog | 2 +- test/indent/perl.perl | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 740d95c29e1..5ea2d4483c4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-04-03 Stefan Monnier + + * progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $' + used as a variable (bug#17174). + 2014-04-02 Stefan Monnier * progmodes/perl-mode.el (perl-indent-new-calculate): 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 diff --git a/src/ChangeLog b/src/ChangeLog index 18b643bfe28..6f42a46cbd4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4231,7 +4231,7 @@ * frame.c (delete_frame): Block/unblock input to overcome race condition (Bug#15475). -2013-09-29 Andreas Politz (tiny change) +2013-09-29 Andreas Politz * frame.c (delete_frame): Record selected frame only after calling Qdelete_frame_functions (Bug#15477). diff --git a/test/indent/perl.perl b/test/indent/perl.perl index 69c1f90c807..7cb877b0a95 100755 --- a/test/indent/perl.perl +++ b/test/indent/perl.perl @@ -16,5 +16,9 @@ EOF1 bar EOF2 +print $'; # This should not start a string! + +print "hello" for /./; + $fileType_filesButNot # bug#12373? = join( '|', map { quotemeta($_).'$' } @{$fileType->{filesButNot}} ); -- 2.39.2