From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.help Subject: How to get decent java-script support Date: Thu, 25 Jun 2015 03:23:16 +0200 Message-ID: <87h9pw37jv.fsf@gmx.us> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1435195432 29787 80.91.229.3 (25 Jun 2015 01:23:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 01:23:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 25 03:23:43 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z7vtF-0000rH-KH for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 03:23:41 +0200 Original-Received: from localhost ([::1]:53485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7vtE-0004dM-RI for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 21:23:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7vt4-0004d6-9t for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 21:23:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7vt1-0005mA-3G for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 21:23:30 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:42101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7vt0-0005m4-SU for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 21:23:27 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Z7vsy-0000dR-O9 for help-gnu-emacs@gnu.org; Thu, 25 Jun 2015 03:23:24 +0200 Original-Received: from 46.166.190.212 ([46.166.190.212]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Jun 2015 03:23:24 +0200 Original-Received: from rasmus by 46.166.190.212 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Jun 2015 03:23:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 53 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 46.166.190.212 User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:MBianllDGovaMOvztHox4DxeLV8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105133 Archived-At: 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