summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-10-04 22:28:55 -0700
committerGlenn Morris <rgm@gnu.org>2011-10-04 22:28:55 -0700
commit8943cfb0c8a7e2c4bcbca20dc5d4a68e4a0eb4e6 (patch)
tree90cc3eff53dd7d963844186e0cd62beb7051760c /lisp/progmodes
parent647ab96713f36faae9509246c418edfa31a569fe (diff)
downloademacs-8943cfb0c8a7e2c4bcbca20dc5d4a68e4a0eb4e6.tar.gz
Small perl-mode fixes.
* lisp/progmodes/perl-mode.el (perl-electric-terminator): Doc fix. (perl-calculate-indent): Suppress scan errors. (Bug#2205)
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/perl-mode.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 933f004bb5d..f051b49fe2a 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -633,8 +633,8 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'."
(defalias 'electric-perl-terminator 'perl-electric-terminator)
(defun perl-electric-terminator (arg)
- "Insert character and adjust indentation.
-If at end-of-line, and not in a comment or a quote, correct the's indentation."
+ "Insert character and maybe adjust indentation.
+If at end-of-line, and not in a comment or a quote, correct the indentation."
(interactive "P")
(let ((insertpos (point)))
(and (not arg) ; decide whether to indent
@@ -832,7 +832,11 @@ Optional argument PARSE-START should be the position of `beginning-of-defun'."
(save-excursion
(beginning-of-line)
(looking-at "\\s-+sub\\>"))
- (> indent-point (save-excursion (forward-sexp 1) (point))))
+ (> indent-point (save-excursion
+ (condition-case nil
+ (forward-sexp 1)
+ (scan-error nil))
+ (point))))
(perl-beginning-of-function))
(while (< (point) indent-point) ;repeat until right sexp
(setq state (parse-partial-sexp (point) indent-point 0))