]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/perl-mode.el
Merge from emacs--devo--0
[gnu-emacs] / lisp / progmodes / perl-mode.el
index a38a5525bc9a6e4b9c54e6c3a40858dba73bb12e..2e7e641096b23d9801cc8526ebb5f0360091fe83 100644 (file)
@@ -267,8 +267,16 @@ The expansion is entirely correct because it uses the C preprocessor."
     ("^[ \t]*format.*=[ \t]*\\(\n\\)" (1 '(7)))
     ;; Funny things in sub arg specifications like `sub myfunc ($$)'
     ("\\<sub\\s-+\\S-+\\s-*(\\([^)]+\\))" 1 '(1))
-    ;; regexp and funny quotes
-    ("[?:.,;=!~({[][ \t\n]*\\(/\\)" (1 '(7)))
+    ;; Regexp and funny quotes.
+    ("\\(?:[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)"
+     (2 (if (and (match-end 1)
+                 (save-excursion
+                   (goto-char (match-end 1))
+                   (skip-chars-backward " \t\n")
+                   (not (memq (char-before)
+                              '(?? ?: ?. ?, ?\; ?= ?! ?~ ?\( ?\[)))))
+            nil ;; A division sign instead of a regexp-match.
+          '(7))))
     ("\\(^\\|[?:.,;=!~({[ \t]\\)\\([msy]\\|q[qxrw]?\\|tr\\)\\>\\s-*\\([^])}> \n\t]\\)"
      ;; Nasty cases:
      ;; /foo/m  $a->m  $#m $m @m %m