emacs-devel
[Top][All Lists]
Advanced

[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: Artur Malabarba
Subject: Re: [elpa] master 6c3842e 2/6: Add scala-mode to excluded-modes (#88)
Date: Wed, 12 Oct 2016 18:05:43 -0300

On 12 October 2016 at 16:48, Stefan Monnier <address@hidden> wrote:
>> --- a/aggressive-indent.el
>> +++ b/aggressive-indent.el
>> @@ -136,6 +136,7 @@ Please include this in your report!"
>>      netcmd-mode
>>      python-mode
>>      sass-mode
>> +    scala-mode
>>      slim-mode
>>      special-mode
>>      shell-mode
>
> Isn't aggressive-indent-excluded-modes a bit blunt/arbitrary?

Indeed. :-(

> I mean, shouldn't we argue for each mode *why* it shouldn't use
> aggressive-indent, and then maybe come up with a way to make this
> variable unnecessary (because we can determine it automatically)?

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

I didn't have time to look for a config option to disable that, (and
even then, I don't think I want aggressive-indent to go around
changing semi-unrelated) so I disabled it in scala-mode.

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

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. We can't avoid these modes simply by
restricting ourselves to modes derived from prog-mode, because some
modes (like html or xml) do make sense to indent but are not derived
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.



reply via email to

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