Subject: bug#16116: 24.3.50; smie-indent-close aligns inner closing paren with the outer opening paren

From: Dmitry Gutov <[email-masked]>
Date: Sat, 14 Dec 2013 20:25:29 +0200

Stefan Monnier <[email-masked]> writes:

> That's exactly what I'm suggesting, yes.

So, call `smie-indent--rule' from `smie-indent-close'? That should work.

>> I thought rather to add a defvar to switch between the two behaviors in
>> smie-indent-close,
>
> That could be acceptable, tho so far all the indentation is controlled
> by the rules-function, so it makes sense to keep it that way rather than
> to introduce a variable.

Maybe so.

> Also, if it's done in the rules-function, the
> function may return different results depending on context.

True, but so far I don't see a situation in Ruby where it'd depend on
the context.

>> or make smie-indent-functions buffer-local and replace
>> smie-indent-close there with a modified implementation.
>
> This approach would work if the requirement is very specific to one
> particular major mode, but in this case, it seems to be a fairly
> common one.

I believe this argument also works against doing it in the rules
function, and in favor of adding a defvar.