]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/perl-mode.el (perl-indent-new-calculate):
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 2 Apr 2014 19:47:50 +0000 (15:47 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 2 Apr 2014 19:47:50 +0000 (15:47 -0400)
Handle forward-sexp failure.

Fixes: debbugs:16985
lisp/ChangeLog
lisp/progmodes/perl-mode.el

index b1c35a78937fab5ac3aabd50f0ae0c200d5176a6..a2322a026e3b9520f53950e41883e273b368d9e6 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/perl-mode.el (perl-indent-new-calculate):
+       Handle forward-sexp failure (bug#16985).
+
 2014-04-02  Glenn Morris  <rgm@gnu.org>
 
        * menu-bar.el (menu-bar-file-menu):
        (electric-indent-mode): Don't mess with the global map any more.
        Don't drop the post-self-insert-hook is some buffer is still using it
        (bug#16770).
+
        * bindings.el (global-map): Remove C-j binding.
 
        * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find
index d09fb59371a80beebc2dbadcced58dc40b4f6a43..3c7571e037ba9857eaabeba7d40795e906a696d0 100644 (file)
@@ -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))