]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/perl-mode.el
Merge from emacs--devo--0
[gnu-emacs] / lisp / progmodes / perl-mode.el
index bb71491da2d46eaa8df0e0825d831af262bf2352..af456f9828487af013cb4c172541eead29fbb6fc 100644 (file)
@@ -266,7 +266,9 @@ The expansion is entirely correct because it uses the C preprocessor."
     ;; format statements
     ("^[ \t]*format.*=[ \t]*\\(\n\\)" (1 '(7)))
     ;; Funny things in sub arg specifications like `sub myfunc ($$)'
-    ("\\<sub\\s-+\\S-+\\s-*(\\([^)]+\\))" 1 '(1))
+    ;; Be careful not to match "sub { (...) ... }".
+    ("\\<sub[[:space:]]+[^{}[:punct:][:space:]]+[[:space:]]*(\\([^)]+\\))"
+     1 '(1))
     ;; Regexp and funny quotes.
     ("\\(?:[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)"
      (2 (if (and (match-end 1)