From c76a7a5cd27eb2359f383d481005bf12010f368e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 16 Apr 2014 10:13:06 -0400 Subject: [PATCH] * lisp/progmodes/perl-mode.el (perl-calculate-indent): Don't auto-indent in here-documents. Fixes: debbugs:17262 --- lisp/ChangeLog | 9 +++++++-- lisp/progmodes/perl-mode.el | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 50dcc78c94..38f71bdd78 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,12 @@ +2014-04-16 Stefan Monnier + + * progmodes/perl-mode.el (perl-calculate-indent): Don't auto-indent in + here-documents (bug#17262). + 2014-04-16 Eli Zaretskii - * term/pc-win.el (x-list-fonts, x-get-selection-value): Provide - doc strings, as required by snarf-documentation. + * term/pc-win.el (x-list-fonts, x-get-selection-value): + Provide doc strings, as required by snarf-documentation. 2014-04-15 Stefan Monnier diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 3486c0a198..f89fec7b1e 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -903,7 +903,9 @@ Optional argument PARSE-START should be the position of `beginning-of-defun'." ;; following_quotep minimum_paren-depth_this_scan) ;; Parsing stops if depth in parentheses becomes equal to third arg. (setq containing-sexp (nth 1 state))) - (cond ((nth 3 state) 'noindent) ; In a quoted string? + (cond + ;; Don't auto-indent in a quoted string or a here-document. + ((or (nth 3 state) (eq 2 (nth 7 state))) 'noindent) ((null containing-sexp) ; Line is at top level. (skip-chars-forward " \t\f") (if (memq (following-char) -- 2.39.2