From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.bugs Subject: bug#20915: 25.0.50; [js-mode] electric annoyances Date: Mon, 29 Jun 2015 13:02:18 +0200 Message-ID: <87d20eydz9.fsf@gmx.us> References: <87oak0njid.fsf@gmx.us> <87bnfzwbio.fsf@gmx.us> <559106B4.1020104@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435575806 25445 80.91.229.3 (29 Jun 2015 11:03:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Jun 2015 11:03:26 +0000 (UTC) To: 20915@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 29 13:03:14 2015 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 1Z9WqG-0001Zc-4F for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 13:03:12 +0200 Original-Received: from localhost ([::1]:41680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9WqF-0002DD-HM for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 07:03:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9WqB-0002AC-7k for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 07:03:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9Wq7-0007tn-Cy for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 07:03:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9Wq7-0007td-Ae for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 07:03:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z9Wq6-0000k4-O7 for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 07:03:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87oak0njid.fsf@gmx.us> Resent-From: Rasmus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jun 2015 11:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20915 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14355757642826 (code B ref -1); Mon, 29 Jun 2015 11:03:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Jun 2015 11:02:44 +0000 Original-Received: from localhost ([127.0.0.1]:60934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9Wpn-0000jS-1H for submit@debbugs.gnu.org; Mon, 29 Jun 2015 07:02:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58425) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9Wpi-0000jC-Uq for submit@debbugs.gnu.org; Mon, 29 Jun 2015 07:02:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9Wpc-0007Qt-MR for submit@debbugs.gnu.org; Mon, 29 Jun 2015 07:02:33 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9Wpc-0007Qp-JY for submit@debbugs.gnu.org; Mon, 29 Jun 2015 07:02:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9Wpb-0001hZ-KW for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 07:02:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9WpX-0007Lh-NU for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 07:02:31 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9WpX-0007L9-Gy for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 07:02:27 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Z9WpV-00019S-Un for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 13:02:26 +0200 Original-Received: from 46.166.138.162 ([46.166.138.162]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Jun 2015 13:02:25 +0200 Original-Received: from rasmus by 46.166.138.162 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Jun 2015 13:02:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 59 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 46.166.138.162 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:hL6nu8AHcZV3uf4rGDJnWeVi47A= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:104469 Archived-At: Dmitry Gutov writes: > On 06/29/2015 04:26 AM, Rasmus wrote: > >> What about differentiating between functions saved to a var or an object >> slot: >> >> var foo = function(a,b){...}; >> baz.f = function(a,b){...}; >> >> Versus functions that are not saved. >> >> [1,2,3].map(function(d){...}); >> >> Is that identifiable and desirable? >> >> I'm expect Dmitry has a better understanding of this issue. > > Looks doable: you skip to the current "function" keyword and see if > it's preceded by an assignment operator. Right. >> And you would not consider the lonely "]" an stylistic annoyance? That, I >> guess, is the work of electric layout. > > I'm not sure it is. Before we start guessing, why don't you write down > the minimal configuration needed to reproduce this? Start with 'emacs > -Q'. In fact I am now unable to reproduce that indentation example again, though the original was created with emacs -q. So ignore it for now. Dmitry Gutov writes: > On 06/29/2015 04:12 AM, Stefan Monnier wrote: > >>> plot.scale.y = d3.scale.ordinal() >>> .domain(bar.ybins) >>> .rangeRoundBands([plot.height, 0 >>> ], 0.1); >> >> electric-indent-mode presumes indentation works correctly. In this >> case, I think we clearly have an indentation bug (can someone imagine >> a sane programmer who'd want the above indentation?), so the thing to do >> is to fix the indentation code. > > Not an indentation bug. The user manually indented the second line, > hence the misalignment. Indeed. The points was whether electric could guess if something is indented and not try to apply indentation. Which is not possible. Thanks, Rasmus -- What will be next?