summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/perl-mode.el11
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))