diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-04-02 15:47:50 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-04-02 15:47:50 -0400 |
commit | 66f50b12dee4e8eff49dcc07ebbe6dcbb69ccd1e (patch) | |
tree | a8e5337d11daff114417d27c26d458bff748c958 /lisp/progmodes | |
parent | ffcd5669d6a71dd9450a9c45b2ea67d3ddc7c988 (diff) | |
download | emacs-66f50b12dee4e8eff49dcc07ebbe6dcbb69ccd1e.tar.gz |
* lisp/progmodes/perl-mode.el (perl-indent-new-calculate):
Handle forward-sexp failure.
Fixes: debbugs:16985
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/perl-mode.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index d09fb59371a..3c7571e037b 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -854,11 +854,12 @@ changed by, or (parse-state) if line starts in a quoted string." (and (= (char-syntax (following-char)) ?\)) (save-excursion (forward-char 1) - (forward-sexp -1) - (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))))) + (when (condition-case nil (progn (forward-sexp -1) t) + (scan-error nil)) + (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)) |