diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 68685fb6625..ff71970d41b 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -1130,14 +1130,7 @@ Returns (parse-state) if line starts inside a string." ;; add the perl-brace-imaginary-offset. (progn (skip-chars-backward " \t") (if (bolp) 0 perl-brace-imaginary-offset)) - ;; If the openbrace is preceded by a parenthesized exp, - ;; move to the beginning of that; - ;; possibly a different line - (progn - (if (eq (preceding-char) ?\)) - (forward-sexp -1)) - ;; Get initial indentation of the line we are on. - (current-indentation))))))))) + (perl-indent-new-calculate 'virtual)))))))) (defun perl-backward-to-noncomment () "Move point backward to after the first non-white-space, skipping comments." diff --git a/test/manual/indent/perl.perl b/test/manual/indent/perl.perl index b44593da028..de76fffa262 100755 --- a/test/manual/indent/perl.perl +++ b/test/manual/indent/perl.perl @@ -5,6 +5,10 @@ ($) return 0; } +find ({ wanted => sub { + return; + }, follow => 1 }, '/tmp'); + # qw(...) is a quoted list of words, so we can and should indent its content! my @tutu = qw[ tata