From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jaseemabid@gmail.com Newsgroups: gmane.emacs.bugs Subject: Re: bug#8576: 23.2; js-mode doesn't support multi-line variable declarations Date: Thu, 5 Jul 2012 07:53:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4DB915B0.7010605@ubercode.de> <4DFE5E2E.2040606@gmail.com> <4F3BA5C1.1080807@ubercode.de> <4F3C06B7.9090205@dancol.org> <033436FB-5DA8-45FF-99CE-93491D1F5116@ubercode.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1341500118 16555 80.91.229.3 (5 Jul 2012 14:55:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Jul 2012 14:55:18 +0000 (UTC) Cc: 8576@debbugs.gnu.org To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 05 16:55:18 2012 Return-path: Envelope-to: geb-bug-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 1SmnSY-0002UW-Ab for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jul 2012 16:55:10 +0200 Original-Received: from localhost ([::1]:44895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmnSX-0004fS-Dd for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jul 2012 10:55:09 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 109 Original-NNTP-Posting-Host: 202.164.150.205 Original-X-Trace: posting.google.com 1341500011 16738 127.0.0.1 (5 Jul 2012 14:53:31 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 5 Jul 2012 14:53:31 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=202.164.150.205; posting-account=qlHYbgoAAADiP6UEkngAlD5wgmBJBKVL User-Agent: G2/1.0 Original-Xref: usenet.stanford.edu gnu.emacs.bug:88071 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61612 Archived-At: On Friday, 1 June 2012 13:00:21 UTC+5:30, Felix H. Dahlke wrote: > Okay, I've prepared a patch for this, based on Dimitriv's work. I= 've > been using this for a while now and haven't run into any problems= . >=20 > =20 >=20 > The attached patch is against the latest revision in the emacs-23 > branch. I can provide a patch for emacs-24 or trunk if that's > desirable. >=20 > =20 >=20 > Here's the patched version if you'd like to try it out: >=20 > =20 > https:/= /gist.github.com/2849799 >=20 > =20 >=20 > And here's one that should work in Emacs 24: >=20 > =20 > https:/= /gist.github.com/2849595 >=20 > =20 >=20 > There's still one thing that I'd like to behave differently, = but I > thought I'd best discuss this first. >=20 > =20 >=20 > The patched js.el will indent the following code like this: >=20 > =20 >=20 > var foo =3D 5, >=20 > =A0=A0=A0=A0=A0 bar =3D function() { >=20 > =A0=A0=A0=A0=A0 }; >=20 > =20 >=20 > That's fine. But if a function or an object literal come first, i= t > indents it like this: >=20 > =20 >=20 > var bar =3D function() { >=20 > }, >=20 > =A0=A0=A0 foo =3D 5; >=20 > =20 >=20 > Which I consider somewhat ugly. I'd like to make it indent as > follows: >=20 > =20 >=20 > var bar =3D function() { >=20 > =A0=A0=A0 }, >=20 > =A0=A0=A0 foo =3D 5; >=20 > =20 >=20 > That should only happen for multi var declarations, single > declarations should indent just like before: >=20 > =20 >=20 > var bar =3D function() { >=20 > }; >=20 > =20 >=20 > Would that be acceptable? It'll make the code a bit more > complicated, but I think it's worth it. >=20 > =20 When the first var is staring with an offset, like inside a nested function= or something, this is failing. It feels like the second line is indented w= rt to coloumn 0 and not wrt to the "var" statement. This is what I expect \t \t var a =3D "foo", \t \t \t b =3D "bar"; but it becomes=20 \t \t var a =3D "foo", \t ..b =3D "bar"; I might be wrong, Im a noob with emacs. Reporting the behavior because the = issue is bugging me a lot. I tried with the gist for v24 on v24.1.1.