From: Rasmus <rasmus@gmx.us>
To: dgutov@yandex.ru
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to get decent java-script support
Date: Thu, 25 Jun 2015 17:03:34 +0200 [thread overview]
Message-ID: <87lhf7ltix.fsf@gmx.us> (raw)
In-Reply-To: <558BC8F1.9010107@yandex.ru> (Dmitry Gutov's message of "Thu, 25 Jun 2015 12:25:05 +0300")
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
next prev parent reply other threads:[~2015-06-25 15:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 1:23 How to get decent java-script support Rasmus
2015-06-25 9:25 ` Dmitry Gutov
2015-06-25 15:03 ` Rasmus [this message]
2015-06-25 15:14 ` Dmitry Gutov
2015-06-25 18:27 ` Rasmus
2015-06-25 18:34 ` Dmitry Gutov
2015-06-25 19:12 ` John Mastro
2015-06-25 21:40 ` Rasmus
2015-06-25 23:49 ` Rasmus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lhf7ltix.fsf@gmx.us \
--to=rasmus@gmx.us \
--cc=dgutov@yandex.ru \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.