bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16116: 24.3.50; smie-indent-close aligns inner closing paren with th


From: Stefan Monnier
Subject: bug#16116: 24.3.50; smie-indent-close aligns inner closing paren with the outer opening paren
Date: Sat, 14 Dec 2013 20:50:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> 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.

Agreed, but we're talking about a change in smie.el, not in ruby-mode.el ;-)

>>> 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.

I don't think so: setting the var is a one-liner, adding the rule to the
rule-function is also a one-liner.  So either way is just as easy for
the major-mode.

By contrast, setting smie-indent-functions buffer-locally, then
removing smie-indent-close from it and adding some other function
requires a lot more code, and a lot more brittle as well (the ordering
in smie-indent-functions is important, the set of functions in there and
their order is not guaranteed to stay unchanged in future versions, the
replacement function needs to be written (delegating to
smie-indent-close seems like it might not work), ...


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]