unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to get decent java-script support?
@ 2015-06-25  1:23 Rasmus
  0 siblings, 0 replies; only message in thread
From: Rasmus @ 2015-06-25  1:23 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I have been working with d3.js.  I'd prefer to retain the same workflow as
with other programming languages, namely having source-code and REPL in
Emacs.

I have tried js and js2 mode.  However, I don't like indentation of these
two modes, including when js2-bounce-indent-p is non-nil.  I cannot get
indentation to respect the "chain-syntax" of d3 (supposedly also used by
jQuery).  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.

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?

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.

Third, related to two, can eldoc somehow be taught to work with JS?

Fourth, REPL.  I tried skewer-mode.  It was OK.  But not great compared to
the REPL in Firefox.  For instance, auto-completion (M-TAB) did not work
at all.  It seems it has some completion support with auto-complete.
Really, I just want M-tab completion...

I would appreciate any hints.

Thanks,
Rasmus


PS: Other modes I tried.

Web-Mode: Indentation seems to work perfectly, and the fact that it can
handle JS, HTML and CSS in one buffer is awesome, but it's too opinionated
in weird areas.  Coloring does not following the normal color names, key
movements do not respect {sub,super}-word-mode, and it uses "/* ⋯ */"
commenting instead of "// ⋯", making comment-dwim not working....

I tried something called tern since it supposedly offer completion for
company.  I don't remember why I dropped it...

I haven't tried js-comint or MozRepl.  Maybe they provide better REPL
experience?

-- 
A clever person solves a problem. A wise person avoids it




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-25  1:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-25  1:23 How to get decent java-script support? Rasmus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).