GNU bug report logs - #16116
24.3.50; smie-indent-close aligns inner closing paren with the outer opening paren

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Thu, 12 Dec 2013 01:58:02 UTC

Severity: minor

Tags: patch

Found in version 24.3.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 16116 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 16116 <at> debbugs.gnu.org, Steve Purcell <steve <at> sanityinc.com>
Subject: Re: 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
>> 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




This bug report was last modified 11 years and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.