diff options
| author | Stefan Monnier | 2014-09-21 18:00:28 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-09-21 18:00:28 -0400 |
| commit | 40aef3780404fa6ecfd97f9d0c9abc4bcf99c5f8 (patch) | |
| tree | 2b5e5cfe9b90c68e8a81cff8f1100c1fbe200eaf | |
| parent | 057ba717037b491d2c18f82268fc89edaa060fe3 (diff) | |
| download | emacs-40aef3780404fa6ecfd97f9d0c9abc4bcf99c5f8.tar.gz emacs-40aef3780404fa6ecfd97f9d0c9abc4bcf99c5f8.zip | |
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Accept underscores in identifiers after "sub".
Fixes: debbugs:18502
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/perl-mode.el | 2 | ||||
| -rwxr-xr-x | test/indent/perl.perl | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ec995c1b406..e726990cacf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-09-21 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * progmodes/perl-mode.el (perl-syntax-propertize-function): | ||
| 4 | Accept underscores in identifiers after "sub" (bug#18502). | ||
| 5 | |||
| 1 | 2014-09-21 Tassilo Horn <tsdh@gnu.org> | 6 | 2014-09-21 Tassilo Horn <tsdh@gnu.org> |
| 2 | 7 | ||
| 3 | * textmodes/reftex-sel.el (reftex-select-label-mode) | 8 | * textmodes/reftex-sel.el (reftex-select-label-mode) |
| @@ -6491,7 +6496,7 @@ | |||
| 6491 | COMMAND-alternatives variable, assign COMMAND as its definition | 6496 | COMMAND-alternatives variable, assign COMMAND as its definition |
| 6492 | name so that `describe-variable' can relocate it. | 6497 | name so that `describe-variable' can relocate it. |
| 6493 | 6498 | ||
| 6494 | 2014-01-14 Matthew Leach <matthew@mattleach.net> (tiny change) | 6499 | 2014-01-14 Matthew Leach <matthew@mattleach.net> |
| 6495 | 6500 | ||
| 6496 | * font-lock.el (font-lock-keywords): Fix typo in docstring | 6501 | * font-lock.el (font-lock-keywords): Fix typo in docstring |
| 6497 | (bug#16307). | 6502 | (bug#16307). |
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 476a98926e2..b4a96e741b7 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el | |||
| @@ -254,7 +254,7 @@ | |||
| 254 | (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end)))) | 254 | (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end)))) |
| 255 | ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'. | 255 | ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'. |
| 256 | ;; Be careful not to match "sub { (...) ... }". | 256 | ;; Be careful not to match "sub { (...) ... }". |
| 257 | ("\\<sub\\(?:[[:space:]]+[^{}[:punct:][:space:]]+\\)?[[:space:]]*(\\([^)]+\\))" | 257 | ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([^)]+\\))" |
| 258 | (1 ".")) | 258 | (1 ".")) |
| 259 | ;; Turn __DATA__ trailer into a comment. | 259 | ;; Turn __DATA__ trailer into a comment. |
| 260 | ("^\\(_\\)_\\(?:DATA\\|END\\)__[ \t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)" | 260 | ("^\\(_\\)_\\(?:DATA\\|END\\)__[ \t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)" |
diff --git a/test/indent/perl.perl b/test/indent/perl.perl index 6b05a5f1d07..00ef312f735 100755 --- a/test/indent/perl.perl +++ b/test/indent/perl.perl | |||
| @@ -1,6 +1,10 @@ | |||
| 1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
| 2 | # -*- eval: (bug-reference-mode 1) -*- | 2 | # -*- eval: (bug-reference-mode 1) -*- |
| 3 | 3 | ||
| 4 | sub add_funds($) { | ||
| 5 | return 0; | ||
| 6 | } | ||
| 7 | |||
| 4 | use v5.14; | 8 | use v5.14; |
| 5 | 9 | ||
| 6 | my $str= <<END; | 10 | my $str= <<END; |