summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2007-08-16 14:20:37 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2007-08-16 14:20:37 +0000
commited0e2ad11b2b80f7a8505b72285c7ff041a5b37b (patch)
tree19fa56a65c155d294d406058cc841ca8a880fb1d /lisp/progmodes
parent4d78a860b9ee2b830d6b9fc67e55c83d516df0c4 (diff)
downloademacs-ed0e2ad11b2b80f7a8505b72285c7ff041a5b37b.tar.gz
(perl-font-lock-syntactic-keywords): Correctly match / regexp matchers
as first char on a line when fontifying only that line.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/perl-mode.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index cfef0eedfe4..f2feff595bb 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -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