[Emacs-ada-mode] Indentation of broken lines in parameter lines

Stephen Leake stephen_leake at stephe-leake.org
Sun Nov 9 15:18:50 PST 2008


Manuel Gomez <mgrojo at gmail.com> writes:

> Stephen Leake wrote:
>> "Manuel Gomez" writes:
>>> Shouldn't "Very_Long_Name_Sample_Package.T_Very_Very_Long_Type_Name;"
>>> be indented as a broken line in the same way used at the procedure
>>> call for "Very_Long_Name_Sample_Package.Very_Very_Long_Constant_Name"?
>>
>> Yes, that would be consistent.
>>
>> It's even worse if you use ada-format-paramlist; that puts the type
>> name back on the same line as the parameter.
>>
>>> Is there a customization for this case?
>>
>> No.
>>
>> The key function here is ada-get-indent-paramlist. It looks like it would
>> be easy to add this case. Can you give it a try? I'm pretty busy at
>> the moment.
>>
>
> Thanks for the help, Stephen.
>
> You were right, the solution has been simple. I just changed the
> indentation from 0 to 'ada-broken-indent for the appropriate case
> (inside a parameter declaration), which was already taken into account
> in the function. I attach the patch.

ok, that is simple! I've applied it in my sources.

> The problem with ada-format-paramlist has also been indirectly solved --
> I don't know how. But there are other problems around over unusual
> layouts, e.g. try setting parameter name, package name and type name
> each one on a line: ada-format-paramlist will remove the type name.

I suspect handling all possible indentation options would be very
complicated. If you run across a real use case for something that
doesn't work, we can look at it.

-- 
-- Stephe



More information about the Emacs-ada-mode mailing list