summaryrefslogtreecommitdiff
path: root/lisp/progmodes/perl-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-11-30 13:43:51 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-11-30 13:43:51 +0000
commit7a9547ca154a37fdb68e953adecbd87b4953b65c (patch)
tree51796cb008ef19d2c4644c421e4cc8856790a50c /lisp/progmodes/perl-mode.el
parent29a483ace468fdb0487c12d7b5644386351ef230 (diff)
downloademacs-7a9547ca154a37fdb68e953adecbd87b4953b65c.tar.gz
emacs-7a9547ca154a37fdb68e953adecbd87b4953b65c.tar.bz2
emacs-7a9547ca154a37fdb68e953adecbd87b4953b65c.zip
(perl-font-lock-special-syntactic-constructs):
Don't signal an error when bumping into EOB in tr, s, or y.
Diffstat (limited to 'lisp/progmodes/perl-mode.el')
-rw-r--r--lisp/progmodes/perl-mode.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 2dedda4fcfa..eaa9bbc6af1 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -273,8 +273,8 @@ The expansion is entirely correct because it uses the C preprocessor."
;; (or some similar separator), or by one of the special keywords
;; corresponding to builtin functions that can take their first arg
;; without parentheses. Of course, that presume we're looking at the
- ;; *opening* slash. We can mis-match the closing ones, because they are
- ;; treated separately later in
+ ;; *opening* slash. We can afford to mis-match the closing ones
+ ;; here, because they will be re-treated separately later in
;; perl-font-lock-special-syntactic-constructs.
(,(concat "\\(?:\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
(regexp-opt '("split" "if" "unless" "until" "while" "split"
@@ -381,13 +381,14 @@ The expansion is entirely correct because it uses the C preprocessor."
'font-lock-multiline t)
;;
(unless
- (save-excursion
- (with-syntax-table
- (perl-quote-syntax-table (char-after))
- (forward-sexp 1))
- (put-text-property pos (line-end-position)
- 'jit-lock-defer-multiline t)
- (looking-at "\\s-*\\sw*e"))
+ (or (eobp)
+ (save-excursion
+ (with-syntax-table
+ (perl-quote-syntax-table (char-after))
+ (forward-sexp 1))
+ (put-text-property pos (line-end-position)
+ jit-lock-defer-multiline t)
+ (looking-at "\\s-*\\sw*e")))
(put-text-property (point) (1+ (point))
'syntax-table
(if (assoc (char-after)