diff lisp/progmodes/cperl-mode.el @ 82431:36aa5fc31532

Fix s{a}{b} parsing
author Vinicius Jose Latorre <viniciusjl@ig.com.br>
date Fri, 17 Aug 2007 18:57:47 +0000
parents 419c5c316b51
children 5c8d5235a4ac a22a8a63b26d aaccdab0ee26
line wrap: on
line diff
--- a/lisp/progmodes/cperl-mode.el	Fri Aug 17 10:10:11 2007 +0000
+++ b/lisp/progmodes/cperl-mode.el	Fri Aug 17 18:57:47 2007 +0000
@@ -3736,8 +3736,12 @@
 	(set-syntax-table reset-st))))
 
 (defsubst cperl-look-at-leading-count (is-x-REx e)
-  (if (re-search-forward (concat "\\=" (if is-x-REx "[ \t\n]*" "") "[{?+*]")
-			 (1- e) t)	; return nil on failure, no moving
+  (if (and (> (point) e)
+	   ;; return nil on failure, no moving
+	   (re-search-forward (concat "\\="
+				      (if is-x-REx "[ \t\n]*" "")
+				      "[{?+*]")
+			      (1- e) t))
       (if (eq ?\{ (preceding-char)) nil
 	(cperl-postpone-fontification
 	 (1- (point)) (point)
@@ -3750,7 +3754,7 @@
 the sections using `cperl-pod-head-face', `cperl-pod-face',
 `cperl-here-face'."
   (interactive)
- (or min (setq min (point-min)
+  (or min (setq min (point-min)
 		cperl-syntax-state nil
 		cperl-syntax-done-to min))
   (or max (setq max (point-max)))
@@ -4785,7 +4789,8 @@
 		      (progn
 			(cperl-postpone-fontification
 			 (1- e1) e1 'face my-cperl-delimiters-face)
-			(if (assoc (char-after b) cperl-starters)
+			(if (and (not (eobp))
+				 (assoc (char-after b) cperl-starters))
 			    (progn
 			      (cperl-postpone-fontification
 			       b1 (1+ b1) 'face my-cperl-delimiters-face)