From: Rasmus <rasmus@gmx.us>
To: help-gnu-emacs@gnu.org
Subject: How to get decent java-script support
Date: Thu, 25 Jun 2015 03:23:16 +0200 [thread overview]
Message-ID: <87h9pw37jv.fsf@gmx.us> (raw)
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
next reply other threads:[~2015-06-25 1:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 1:23 Rasmus [this message]
2015-06-25 9:25 ` How to get decent java-script support Dmitry Gutov
2015-06-25 15:03 ` Rasmus
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h9pw37jv.fsf@gmx.us \
--to=rasmus@gmx.us \
--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.
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).