]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 21 Sep 2014 22:00:28 +0000 (18:00 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 21 Sep 2014 22:00:28 +0000 (18:00 -0400)
Accept underscores in identifiers after "sub".

Fixes: debbugs:18502
lisp/ChangeLog
lisp/progmodes/perl-mode.el
test/indent/perl.perl

index ec995c1b406140e47071b671ff728ead204d8f1a..e726990cacfb8355daf325cac8dcf3b5adfe5298 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/perl-mode.el (perl-syntax-propertize-function):
+       Accept underscores in identifiers after "sub" (bug#18502).
+
 2014-09-21  Tassilo Horn  <tsdh@gnu.org>
 
        * textmodes/reftex-sel.el (reftex-select-label-mode)
        COMMAND-alternatives variable, assign COMMAND as its definition
        name so that `describe-variable' can relocate it.
 
-2014-01-14  Matthew Leach  <matthew@mattleach.net>  (tiny change)
+2014-01-14  Matthew Leach  <matthew@mattleach.net>
 
        * font-lock.el (font-lock-keywords): Fix typo in docstring
        (bug#16307).
index 476a98926e2584728b4e18c9542722953bb94163..b4a96e741b78a648917e7eb5967395588c05e5a3 100644 (file)
        (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end))))
       ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'.
       ;; Be careful not to match "sub { (...) ... }".
-      ("\\<sub\\(?:[[:space:]]+[^{}[:punct:][:space:]]+\\)?[[:space:]]*(\\([^)]+\\))"
+      ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([^)]+\\))"
        (1 "."))
       ;; Turn __DATA__ trailer into a comment.
       ("^\\(_\\)_\\(?:DATA\\|END\\)__[ \t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)"
index 6b05a5f1d07285ed5990f53bf04e2e7c9b6afcbf..00ef312f735fefbf0b71a17fec4499a35b0cec8f 100755 (executable)
@@ -1,6 +1,10 @@
 #!/usr/bin/perl
 # -*- eval: (bug-reference-mode 1) -*-
 
+sub add_funds($) {
+    return 0;
+}
+
 use v5.14;
 
 my $str= <<END;