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

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

Re: How to get decent java-script support


From: Rasmus
Subject: Re: How to get decent java-script support
Date: Thu, 25 Jun 2015 17:03:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Hi Dmitry,

Thanks for your pointers.

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 06/25/2015 04:23 AM, Rasmus wrote:
>> Also, it inserts lots of newlines e.g. for "{}" pairs, which is
>> annoying for inline functions (e.g. in .map arguments).  I tried to turn
>> off electricity, but that didn't make it stop with the excessive newlines.
>
> This sounds like you're turned on electric-layout-mode, somewhere in
> your config.

Spot on.  Thanks.

>> Some question on JS in Emacs:
>>
>> First, is it possible to get js(2) mode to allow chain-style indentation
>> and be less, or more, clever about braces and semicolons?
>
> There are some vars you can customize, but probably not enough.

Would you mind if I open a bug on that on github?  I don't know if it's a
d3 thing or something that is generally useful for JS.

It's can get pretty nasty so I don't know if rules can be written.
E.g.

var myvar = d3.select("#whatever")
              .somefun(arg)
              .call(d3.something_else(arg)
                      .anotherfun(arg));

You'd not actually write code like that of course (the something_else call
would be factored out to a separate var), so for the majority of code it
would be enough to just align on the first dot.

>> Second, can one somehow connect hook into some sort of documentation
>> system with java-script?  At least for standard ECMAScript?  Like
>> "help(fun)" in Python and C-h for Emacs Lisp etc etc.  At this point, I
>> could even live with it "just" opening Mozilla dev. pages in eww or
>> Firefox.
>
> Tern supports completion and documentation lookup.

OK, I will have to give it another shot.

>> Third, related to two, can eldoc somehow be taught to work with JS?
>
> That may be a good feature request for tern-mode.

OK.  I will open a bug.

Rasmus

-- 
In theory, practice and theory are the same. In practice they are not








reply via email to

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