From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#8576: 23.2; js-mode doesn't support multi-line variable declarations Date: Tue, 17 Jul 2012 09:00:14 +0400 Message-ID: <5004F15E.9040101@yandex.ru> References: <4DB915B0.7010605@ubercode.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1342501272 26566 80.91.229.3 (17 Jul 2012 05:01:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 17 Jul 2012 05:01:12 +0000 (UTC) Cc: 8576@debbugs.gnu.org To: fhd@ubercode.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 17 07:01:11 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 1SqzuI-0007tD-6d for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Jul 2012 07:01:10 +0200 Original-Received: from localhost ([::1]:58343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqzuH-00034D-7l for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Jul 2012 01:01:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqzuE-00033x-CB for bug-gnu-emacs@gnu.org; Tue, 17 Jul 2012 01:01:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqzuD-0003Pn-DH for bug-gnu-emacs@gnu.org; Tue, 17 Jul 2012 01:01:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqzuD-0003Pf-55 for bug-gnu-emacs@gnu.org; Tue, 17 Jul 2012 01:01:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sqzzy-0000eR-Gn for bug-gnu-emacs@gnu.org; Tue, 17 Jul 2012 01:07:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <4DB915B0.7010605@ubercode.de> Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Jul 2012 05:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8576 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8576-submit@debbugs.gnu.org id=B8576.13425016012462 (code B ref 8576); Tue, 17 Jul 2012 05:07:02 +0000 Original-Received: (at 8576) by debbugs.gnu.org; 17 Jul 2012 05:06:41 +0000 Original-Received: from localhost ([127.0.0.1]:45020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sqzzc-0000df-Rm for submit@debbugs.gnu.org; Tue, 17 Jul 2012 01:06:41 -0400 Original-Received: from forward15.mail.yandex.net ([95.108.130.119]:34946) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SqzzY-0000dU-8T for 8576@debbugs.gnu.org; Tue, 17 Jul 2012 01:06:38 -0400 Original-Received: from smtp12.mail.yandex.net (smtp12.mail.yandex.net [95.108.131.191]) by forward15.mail.yandex.net (Yandex) with ESMTP id 7D2E39E0A0A; Tue, 17 Jul 2012 09:00:34 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1342501234; bh=o1Ew3l4szumAzzB4E15IjxdAS6E0VzbLIuzSzF3cROY=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:Content-Type: Content-Transfer-Encoding; b=cmD20XOWknmtw6BF/B2+BArRrSH3of1214swV15R6aZ7xHmXZJZ2OqXsiohR3ZhNl CCyEST8FPft8+3d0ae0+a6P0v9cBVvCD6NMrmm6qN0C+dLOdupfq/Ak6YF6KCGxyoA PYeqGgqhFpwPx0tFGsC0PZZzBnN77Z4HVzR2qq4E= Original-Received: from smtp12.mail.yandex.net (localhost [127.0.0.1]) by smtp12.mail.yandex.net (Yandex) with ESMTP id 4B43816A0786; Tue, 17 Jul 2012 09:00:34 +0400 (MSK) Original-Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp12.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 0XOubQeV-0XOuGuWl; Tue, 17 Jul 2012 09:00:33 +0400 X-Yandex-Rcpt-Suid: fhd@ubercode.de X-Yandex-Rcpt-Suid: 8576@debbugs.gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1342501234; bh=o1Ew3l4szumAzzB4E15IjxdAS6E0VzbLIuzSzF3cROY=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: Content-Type:Content-Transfer-Encoding; b=WDLGLJZ4fh1Y3GHFizSegr7gyeW6bSCGxXiJ4g92o4ndw7igGuD0ob8/S3AJyC0jJ mA09d96XF7aCwiSyi3+hlkruHKTkFstai3GxCEllBUpjSLGdlQBn9QbMQk3fIUg/Si jXqtqws9Ba2bsYGKUWnZMzNks/bhKMV7XfegZvyE= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org 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:62020 Archived-At: "Felix H. Dahlke" writes: > On 07/17/2012 06:21 AM, Dmitry Gutov wrote: > I've updated the gists and attached a new patch. I'm sorry, I spoke too soon. Now I see that your patch relies on the value of `js-indent-level' being 4. And what if the keyword is "const"? Unless you're fine with the following indentation, the patch I posted earlier is better: const a = 5, b = 6; >>> The only solution I can think of would be to go back up after >>> typing a closing brace followed by a comma and indent the >>> preceeding lines. >>> Some modes do that, but it would require drastic changes to js.el. >>> I'd rather get this patch in first and see if the issue annoys me >>> (or anyone else) enough to work further on this. >> >> I don't think this will be much of a problem. > > Probably not, but I fear it's going to be a lot of work - at least > when I do it. I meant that nobody will care, most likely. But the implementation shouldn't be too hard either - add a function to `post-command-hook' which would check if the command is `self-insert-command', check if we inserted a comma, skip backward to the previous non-whitespace char, see if it's } or ], etc. --Dmitry