aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-01-24 15:10:04 -0500
committerStefan Monnier2011-01-24 15:10:04 -0500
commitab0a61d0acb81353f5636a9c42bec7762dd90c81 (patch)
tree599929ac86b73970c28dca0ce2b3ae35ae8ef83c
parent21bb5ce0dd56f69d661d3d386c1cd3cef12a1d36 (diff)
downloademacs-ab0a61d0acb81353f5636a9c42bec7762dd90c81.tar.gz
emacs-ab0a61d0acb81353f5636a9c42bec7762dd90c81.zip
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-special-constructs):
Don't move backward, so as not to fall in an inf-loop. Fixes: debbugs:7736
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/progmodes/perl-mode.el6
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0a2b34cb024..62aeaf7f92f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12011-01-24 Stefan Monnier <monnier@iro.umontreal.ca> 12011-01-24 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * progmodes/perl-mode.el (perl-syntax-propertize-special-constructs):
4 Don't move backward, so as not to fall in an inf-loop (bug#7736).
5
3 * progmodes/ruby-mode.el (ruby-syntax-propertize-function): (bug#7735) 6 * progmodes/ruby-mode.el (ruby-syntax-propertize-function): (bug#7735)
4 Handle ?" and friends differently (e.g. don't use backrefs). 7 Handle ?" and friends differently (e.g. don't use backrefs).
5 8
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 85429ac96af..64cf2c989c2 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -360,7 +360,8 @@ The expansion is entirely correct because it uses the C preprocessor."
360 (t 360 (t
361 ;; This is regexp like quote thingy. 361 ;; This is regexp like quote thingy.
362 (setq char (char-after (nth 8 state))) 362 (setq char (char-after (nth 8 state)))
363 (let ((twoargs (save-excursion 363 (let ((startpos (point))
364 (twoargs (save-excursion
364 (goto-char (nth 8 state)) 365 (goto-char (nth 8 state))
365 (skip-syntax-backward " ") 366 (skip-syntax-backward " ")
366 (skip-syntax-backward "w") 367 (skip-syntax-backward "w")
@@ -384,7 +385,8 @@ The expansion is entirely correct because it uses the C preprocessor."
384 (goto-char (1+ (nth 8 state))) 385 (goto-char (1+ (nth 8 state)))
385 (up-list 1) 386 (up-list 1)
386 t) 387 t)
387 (scan-error nil)) 388 ;; In case of error, make sure we don't move backward.
389 (scan-error (goto-char startpos) nil))
388 (not (or (nth 8 (parse-partial-sexp 390 (not (or (nth 8 (parse-partial-sexp
389 (point) limit nil nil state 'syntax-table)) 391 (point) limit nil nil state 'syntax-table))
390 ;; If we have a self-paired opener and a twoargs 392 ;; If we have a self-paired opener and a twoargs