aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-04-02 15:47:50 -0400
committerStefan Monnier2014-04-02 15:47:50 -0400
commit66f50b12dee4e8eff49dcc07ebbe6dcbb69ccd1e (patch)
treea8e5337d11daff114417d27c26d458bff748c958
parentffcd5669d6a71dd9450a9c45b2ea67d3ddc7c988 (diff)
downloademacs-66f50b12dee4e8eff49dcc07ebbe6dcbb69ccd1e.tar.gz
emacs-66f50b12dee4e8eff49dcc07ebbe6dcbb69ccd1e.zip
* lisp/progmodes/perl-mode.el (perl-indent-new-calculate):
Handle forward-sexp failure. Fixes: debbugs:16985
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/perl-mode.el11
2 files changed, 12 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b1c35a78937..a2322a026e3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-04-02 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/perl-mode.el (perl-indent-new-calculate):
4 Handle forward-sexp failure (bug#16985).
5
12014-04-02 Glenn Morris <rgm@gnu.org> 62014-04-02 Glenn Morris <rgm@gnu.org>
2 7
3 * menu-bar.el (menu-bar-file-menu): 8 * menu-bar.el (menu-bar-file-menu):
@@ -210,6 +215,7 @@
210 (electric-indent-mode): Don't mess with the global map any more. 215 (electric-indent-mode): Don't mess with the global map any more.
211 Don't drop the post-self-insert-hook is some buffer is still using it 216 Don't drop the post-self-insert-hook is some buffer is still using it
212 (bug#16770). 217 (bug#16770).
218
213 * bindings.el (global-map): Remove C-j binding. 219 * bindings.el (global-map): Remove C-j binding.
214 220
215 * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find 221 * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find
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."
854 (and (= (char-syntax (following-char)) ?\)) 854 (and (= (char-syntax (following-char)) ?\))
855 (save-excursion 855 (save-excursion
856 (forward-char 1) 856 (forward-char 1)
857 (forward-sexp -1) 857 (when (condition-case nil (progn (forward-sexp -1) t)
858 (perl-indent-new-calculate 858 (scan-error nil))
859 ;; Recalculate the parsing-start, since we may have jumped 859 (perl-indent-new-calculate
860 ;; dangerously close (typically in the case of nested functions). 860 ;; Recalculate the parsing-start, since we may have jumped
861 'virtual nil (save-excursion (perl-beginning-of-function))))) 861 ;; dangerously close (typically in the case of nested functions).
862 'virtual nil (save-excursion (perl-beginning-of-function))))))
862 (and (and (= (following-char) ?{) 863 (and (and (= (following-char) ?{)
863 (save-excursion (forward-char) (perl-hanging-paren-p))) 864 (save-excursion (forward-char) (perl-hanging-paren-p)))
864 (+ (or default (perl-calculate-indent parse-start)) 865 (+ (or default (perl-calculate-indent parse-start))