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

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

bug#20915: 25.0.50; [js-mode] electric annoyances


From: Rasmus
Subject: bug#20915: 25.0.50; [js-mode] electric annoyances
Date: Mon, 29 Jun 2015 13:02:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 06/29/2015 04:26 AM, Rasmus wrote:
>
>> What about differentiating between functions saved to a var or an object
>> slot:
>>
>>      var foo = function(a,b){...};
>>      baz.f = function(a,b){...};
>>
>> Versus functions that are not saved.
>>
>>      [1,2,3].map(function(d){...});
>>
>> Is that identifiable and desirable?
>>
>> I'm expect Dmitry has a better understanding of this issue.
>
> Looks doable: you skip to the current "function" keyword and see if
> it's preceded by an assignment operator.

Right.

>> And you would not consider the lonely "]" an stylistic annoyance?  That, I
>> guess, is the work of electric layout.
>
> I'm not sure it is. Before we start guessing, why don't you write down
> the minimal configuration needed to reproduce this? Start with 'emacs
> -Q'.

In fact I am now unable to reproduce that indentation example again,
though the original was created with emacs -q.  So ignore it for now.


Dmitry Gutov <dgutov@yandex.ru> writes:

> On 06/29/2015 04:12 AM, Stefan Monnier wrote:
>
>>> plot.scale.y = d3.scale.ordinal()
>>>                         .domain(bar.ybins)
>>>      .rangeRoundBands([plot.height, 0
>>>                  ], 0.1);
>>
>> electric-indent-mode presumes indentation works correctly.  In this
>> case, I think we clearly have an indentation bug (can someone imagine
>> a sane programmer who'd want the above indentation?), so the thing to do
>> is to fix the indentation code.
>
> Not an indentation bug. The user manually indented the second line,
> hence the misalignment.

Indeed.  The points was whether electric could guess if something is
indented and not try to apply indentation.  Which is not possible.

Thanks,
Rasmus

-- 
What will be next?






reply via email to

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