[Wellington-pm] My new indentation technique is unstoppable!!

Cliff Pratt enkidu at cliffp.com
Sat Aug 16 15:09:35 PDT 2008


Sam Vilain wrote:
> Richard Hector wrote:
>> On Fri, 2008-08-15 at 13:52 +1200, Sam Vilain wrote:
>>
>>>    eg, not
>>>      Object->new( param => foo,
>>>      ␠␠␠␠␠␠␠␠␠␠␠␠␠param => bar);
>>>      function(arg, arg, arg,
>>>      ␠␠␠␠␠␠␠␠␠arg, arg);
>>>    but:
>>>      Object->new
>>>      → ( param => foo,
>>>      → ␠␠param => bar,
>>>      → );
>>>      function
>>>      → ( arg, arg, arg,
>>>      → ␠␠arg, arg,
>>>        );
>>>
>>>     this is the sort of thing that leads to easy mergability of code,
>>>     because the logical parts of the function call are all on seperate
>>>     lines, and to add a list item you can just insert a line.
>> But to delete the first argument or add a new first argument, you have
>> to edit the line with the opening (.
>>
>> Why not
>>
>> Object->new (
>>   param => foo,
>>   param => bar,
>> );
>>
>> with either tabs or spaces.
> 
> Yeah, that's a good point.  I guess my primary reason is that then emacs
> wanted to indent the following lines after the bracket, which is a
> pretty poor reason ;-)
> 
> This would make it more consistent with:  if (condition) { ... }
> indenting, too.
> 
What is 'emacs'? Is it something like 'sed'? 8-)

Cheers,

Cliff


More information about the Wellington-pm mailing list