jrockway / cperl-mode

cperl-mode with 5.10 fixes, mx-declare support, perl6 support, etc.
102 stars 33 forks source link

Make cperl-calculate-indent a little more pluggable #16

Closed pdcawley closed 11 years ago

pdcawley commented 11 years ago

From the commit:

cperl-calculate-indent is monolithic function. This makes things tricky if you just want to override the behaviour of one return type from cperl-sniff-for-indent. So... I've extended cperl-indent-rules-alist to allow for its holding a symbol to be called as a function.

Also, made things behave as documented when the rules alist is with a number, that number is now treated as an offset, not a column number. 'nil is treated as 'absolute column 0'.

I've used this change to experiment with making:

my @foo = qw(
    some list of words
);

Indent in a blocklike fashion as above rather than with cperl-mode's current behaviour.

renormalist commented 11 years ago

Cool, thanks! I tend to just merge, although I don't have time to verify it works. I will wait a bit to hear objections from jrockway and then go ahead.

pdcawley commented 11 years ago

The idea is that it shouldn't affect anything if you're not plugging in new behaviour. You have to actually futz with the alist for that so it should go pretty clean.

On 20 June 2013 02:39, Steffen Schwigon notifications@github.com wrote:

Cool, thanks! I tend to just merge, although I don't have time to verify it works. I will wait a bit to hear objections from jrockway and then go ahead.

— Reply to this email directly or view it on GitHubhttps://github.com/jrockway/cperl-mode/pull/16#issuecomment-19726175 .

renormalist commented 11 years ago

Thanks!