Browse files

add custom option to indent sub { like everything else

  • Loading branch information...
1 parent 80fba9b commit af2d4cd808a1aa88d18ecff2f8a165765da40d47 @jrockway committed Jul 1, 2009
Showing with 6 additions and 0 deletions.
  1. +6 −0 cperl-mode.el
@@ -299,6 +299,11 @@ Versions 5.2 ... 5.20 behaved as if this were `nil'."
:type 'boolean
:group 'cperl-indentation-details)
+(defcustom cperl-indent-subs-specially t
+ "*Non-nil means indent subs that are inside other blocks (hash values, for example) relative to the beginning of the \"sub\" keyword, rather than relative to the statement that contains the declaration."
+ :type 'boolean
+ :group 'cperl-indentation-details)
(defcustom cperl-auto-newline nil
"*Non-nil means automatically newline before and after braces,
and after colons and semicolons, inserted in CPerl code. The following
@@ -2997,6 +3002,7 @@ Will not look before LIM."
;; first thing on the line, say in the case of
;; anonymous sub in a hash.
(if (and;; Is it a sub in group starting on this line?
+ cperl-indent-subs-specially
(cond ((get-text-property (point) 'attrib-group)
(goto-char (cperl-beginning-of-property
(point) 'attrib-group)))

0 comments on commit af2d4cd

Please sign in to comment.