[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [elpa] master 6c3842e 2/6: Add scala-mode to excluded-modes (#88)
From: |
Stefan Monnier |
Subject: |
Re: [elpa] master 6c3842e 2/6: Add scala-mode to excluded-modes (#88) |
Date: |
Wed, 12 Oct 2016 18:07:58 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
> Scala-mode was added because it takes the liberty of doing some
> whitespace cleanup during indent-region, so it was preventing users
> from typing properly. See:
> https://github.com/Malabarba/aggressive-indent-mode/issues/87
BTW, another way to avoid this problem is to skip reindentation if
(and (eolp) (memq (char-before) '(?\s ?\t))).
>> E.g. maybe some of those modes shouldn't use aggressive-indent simply
>> because auto-reindentation can't be done reliably (in which case,
>> aggressive-indent could check something like electric-indent-inhibit
>> which was introduced for the same kind of needs)...
> Yes. A lot of these are there for this reason, and we could use
> `electric-indent-inhibit` for that (I didn't know about it).
Maybe we should have another variable that's not bound to
electric-indent, something like `indent-is-not-reliable'.
> Other modes are there because indentation makes no sense for them at
> all. Such as shell-mode, which I see doesn't set
> electric-indent-inhibit.
AFAIK shell-mode's indentation works just fine and reliably. Maybe you
don't need it when you write 2-line scripts, but for larger scripts
(such as https://gitlab.com/monnier/bugit/blob/master/bugit), it makes
just as much sense as for any other programming language.
> from prog-mode. Now that I have the advantage of hindsight, I see it
> would have been easier to restrict to prog-mode and implement a
> white-list, instead of taking everything and implementing a
> black-list.
electric-indent does OK with a black list, so maybe it was not such
a bad decision.
Stefan