summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/perl-mode.el5
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b7dcf022996..32b8304044f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/perl-mode.el (perl-indent-new-calculate):
+ Recompute parse-start after jumping backward by a whole sexp.
+
2006-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
* vc.el (vc-ensure-vc-buffer): Only change current-buffer, not the
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index b0e31bafc28..e92bb1053a6 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -721,7 +721,10 @@ changed by, or (parse-state) if line starts in a quoted string."
(save-excursion
(forward-char 1)
(forward-sexp -1)
- (perl-indent-new-calculate 'virtual nil parse-start)))
+ (perl-indent-new-calculate
+ ;; Recalculate the parsing-start, since we may have jumped
+ ;; dangerously close (typically in the case of nested functions).
+ 'virtual nil (save-excursion (perl-beginning-of-function)))))
(and (and (= (following-char) ?{)
(save-excursion (forward-char) (perl-hanging-paren-p)))
(+ (or default (perl-calculate-indent parse-start))