1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

Small perl-mode fixes.

* lisp/progmodes/perl-mode.el (perl-electric-terminator): Doc fix.
(perl-calculate-indent): Suppress scan errors.  (Bug#2205)
This commit is contained in:
Glenn Morris 2011-10-04 22:28:55 -07:00
parent 647ab96713
commit 8943cfb0c8
2 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2011-10-05 Glenn Morris <rgm@gnu.org>
* progmodes/perl-mode.el (perl-electric-terminator): Doc fix.
(perl-calculate-indent): Suppress scan errors. (Bug#2205)
2011-10-05 Leo Liu <sdl.web@gmail.com>
* subr.el (read-char-choice): Fix argument to buffer-live-p which

View file

@ -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))