From: Stefan Monnier Date: Wed, 12 Apr 2006 05:11:12 +0000 (+0000) Subject: (perl-indent-new-calculate): Recompute parse-start after jumping backward by X-Git-Tag: emacs-pretest-22.0.90~3202 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=16a3b9b72cb7384be867dda93d9a6e71fd5e4847;p=emacs.git (perl-indent-new-calculate): Recompute parse-start after jumping backward by a whole sexp. --- 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 + + * progmodes/perl-mode.el (perl-indent-new-calculate): + Recompute parse-start after jumping backward by a whole sexp. + 2006-04-11 Stefan Monnier * 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))