emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r116895: * lisp/progmodes/perl-mode.el (perl-inde


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-24 r116895: * lisp/progmodes/perl-mode.el (perl-indent-new-calculate):
Date: Wed, 02 Apr 2014 19:47:56 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116895
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16985
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Wed 2014-04-02 15:47:50 -0400
message:
  * lisp/progmodes/perl-mode.el (perl-indent-new-calculate):
  Handle forward-sexp failure.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/perl-mode.el    perlmode.el-20091113204419-o5vbwnq5f7feedwu-402
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-04-02 07:07:11 +0000
+++ b/lisp/ChangeLog    2014-04-02 19:47:50 +0000
@@ -1,3 +1,8 @@
+2014-04-02  Stefan Monnier  <address@hidden>
+
+       * progmodes/perl-mode.el (perl-indent-new-calculate):
+       Handle forward-sexp failure (bug#16985).
+
 2014-04-02  Glenn Morris  <address@hidden>
 
        * menu-bar.el (menu-bar-file-menu):
@@ -210,6 +215,7 @@
        (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

=== modified file 'lisp/progmodes/perl-mode.el'
--- a/lisp/progmodes/perl-mode.el       2014-02-10 01:34:22 +0000
+++ b/lisp/progmodes/perl-mode.el       2014-04-02 19:47:50 +0000
@@ -854,11 +854,12 @@
    (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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]