From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.help Subject: Re: How to get decent java-script support Date: Thu, 25 Jun 2015 17:03:34 +0200 Message-ID: <87lhf7ltix.fsf@gmx.us> References: <87h9pw37jv.fsf@gmx.us> <558BC8F1.9010107@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435244661 12852 80.91.229.3 (25 Jun 2015 15:04:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 15:04:21 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: dgutov@yandex.ru Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 25 17:04:14 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 1Z88hH-0008Ip-JH for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 17:04:11 +0200 Original-Received: from localhost ([::1]:56129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z88hG-0001tR-VJ for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 11:04:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z88h3-0001t2-DB for help-gnu-emacs@gnu.org; Thu, 25 Jun 2015 11:04:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z88gx-0004RT-Ki for help-gnu-emacs@gnu.org; Thu, 25 Jun 2015 11:03:57 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:52049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z88gx-0004QO-8o for help-gnu-emacs@gnu.org; Thu, 25 Jun 2015 11:03:51 -0400 Original-Received: from x200s ([90.163.164.75]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MhiPD-1ZV17q1N8F-00MsAZ; Thu, 25 Jun 2015 17:03:47 +0200 In-Reply-To: <558BC8F1.9010107@yandex.ru> (Dmitry Gutov's message of "Thu, 25 Jun 2015 12:25:05 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:pSjkrM6/aNKoJgRVyxUcFrhl1XmpR4zaQPFmF1GbvlTf5iZnqbQ qc7KOfrkyt+GmzWoqb2SYYVyFh0Ao4Hqhp1zm2H/9f8qec67Ur8fhquj61UsQKFZr8UNxKS HCMiOyE2OsJnaBv73AGUd6wIBxuetcywPdKsjn5h4WkZRM98Tv1QzLUbD/lYAppE8DM5ey1 zy8hCWrhJbnDt8U+YIKBQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:VwI2mLS9i8c=:jpOArL73VsUKbPLnOjRBkA LEkC6vQ996P136YDWt5gUicb7dxhO8uGkKlxGfRfUtwIi9r54amOCcfm8a7r/xZHlaO7/cwYO iddq2QB81DIkhABUddcdTCAixjwwA3JSE8U6TyE9PU1ynZ0ARhG0kPcAzjoLDTwD7QTsOa5Ct dq+fRvJnhmnF9icBt0THZKV+EFzmaKg1qEB6w+mUf4asMSGLQBm4nw8E+t8xnyDYPbev4VICJ 75WjoCrgZx4JsDkHN21Dxtb0YrsQzYRswdpUGAE7ETUTSnqHzl3Z5Wy+heqE9i21PfNcAOH9i AtQIggzbQrI7D4qrB41TpRXVZzCxm66aMzK6X5mEDxOzTzpRHzKUeAQVyt24D29H4ly1mn43g 2LdQGRDl6s9A0Q/vntG+53XEmy3FIIlkX+CqLHyBtRfCcbESyKwkPwpBuTVBIJkf+97YEQekY s7X/6tPglP6xrJwmonm2/zrG9O45hCe0KMYxJ4fKU9UvjK74TFtJlt+Tb9s1FjMQOOLSptA49 ORQ/Prk2eHMf2s9hNi78PtRCjxV+7jqROEQFiysfoN9b+I6aCC8xznKxhTDN9XX3QFY9gKJKq E4cILu67Sgd+LUzhabzCLt3WgA7u1Q6xszVreXj+iQuO5VSbGmX562HF4q2krdvT55QXt2mjo 0b0co1oYvh1R1LntwZtkhoVHJ/bw6Yk9dpYMOez6vq8UHqsTKtAIA4uhilZKc+I0oU5Q= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.19 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:105157 Archived-At: Hi Dmitry, Thanks for your pointers. Dmitry Gutov 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