From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#35254: 27.0.50; cc-mode/electric-pair-mode/electric-layout-mode: bad trailing whitespace behavior in cc-mode Date: Tue, 14 May 2019 02:20:52 +0100 Message-ID: References: <87ftqms9db.fsf@secretsauce.net> <871s15k7ll.fsf@gmail.com> <20190513195323.GB5525@ACM> <87a7fphqlz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b692500588ced8bd" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="193976"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Alan Mackenzie , Stefan Monnier , 35254@debbugs.gnu.org, Dima Kogan To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 14 05:58:01 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQOZk-000oHH-KR for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 May 2019 05:58:00 +0200 Original-Received: from localhost ([127.0.0.1]:38620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQOZj-0002HW-Ee for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2019 23:57:59 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQOZc-0002HA-CV for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 23:57:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQM8p-0002lm-J1 for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 21:24:50 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33178) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQM8p-0002kU-8N; Mon, 13 May 2019 21:22:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQM8o-0002oW-TM; Mon, 13 May 2019 21:22:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 14 May 2019 01:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35254 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 35254-submit@debbugs.gnu.org id=B35254.155779687110731 (code B ref 35254); Tue, 14 May 2019 01:22:02 +0000 Original-Received: (at 35254) by debbugs.gnu.org; 14 May 2019 01:21:11 +0000 Original-Received: from localhost ([127.0.0.1]:46717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQM7z-0002n0-5c for submit@debbugs.gnu.org; Mon, 13 May 2019 21:21:11 -0400 Original-Received: from mail-it1-f171.google.com ([209.85.166.171]:33257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQM7x-0002mm-OT for 35254@debbugs.gnu.org; Mon, 13 May 2019 21:21:10 -0400 Original-Received: by mail-it1-f171.google.com with SMTP id u16so1397968itc.0 for <35254@debbugs.gnu.org>; Mon, 13 May 2019 18:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ri86yR31qnM4/NHQ7IfAczHv3roLXYJhqREqV3J9jYk=; b=p56IZo+ZRD8IR3DnZQH7VKz3jkHJMoSLXmgzLMmkHVvdmKj+dAUrbGKY6ZZ6ytZZ6m Z8ewzdRP9Hgz1/wrt4DhOWB5lv2l9WkMB4s0AhQfmRcaDMggVve2fjT07UcX+dxN/rTc h0ewsCgKbDIiYmfB7qlCaN37V0/0xgig1tgfMhuqJwlVdmJm/Rf3OLUP6Rq7xKjkTCH6 Fur+r0EQjMhc44Xazp9w/45L1Vl7Dhwd8IDhPdeGCVPQGJkZkXQMv05bGioUWkQNd4mM Msyi59LhmOHI53aSLBhD4o4cTL2DItosv9cl518fhzClOn72PIFPotnKurrg1nWqw+HW He/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ri86yR31qnM4/NHQ7IfAczHv3roLXYJhqREqV3J9jYk=; b=Ymo0Ak6DlkVys1DpbA5ho2JGMg2sTS9iaYQkX2lr3osdV9S3pAtvi2Q5nf6PP9bDV3 cRPHdZBlc+tDajKXDoxc7e3ARQeECwaxO3efaOlrL1MV+bqVn/k3BPgc7n9RSwlOLGXq atm2nbmuxPqu2MO5E9lvNJsRClxDnmKQaiAIYRlHFw0rfhT41fWhuxE9KWGzXggMekIQ kF5EvFiP/PvB2apVo+EX/JodDPCM7U17GskYQ+X0n5WwTTrSfnkTNo5PEj5YXHW38xfV OB/wpiAGRRZ3KCNBjqWZKQJseWM5POejvVo62ui5+j11XOG8u2I3LvWiTObqIP2SM6FF iwHw== X-Gm-Message-State: APjAAAUZN+ygVZGHhG8ridQe0W7tz3BaDBbU3hDjXbHJgp17/mkTw4Jn VBeW51b7B9qFwglho9dynArG8/LXKiFDs3vYMJs= X-Google-Smtp-Source: APXvYqzf430fSx9wOlPgull5T5R2mTb9Q7q9o+HHNO+wAaZataWuDNYSregCcqf96nGCNRN+VQOQmi4eeBwb+Dg76NA= X-Received: by 2002:a05:660c:243:: with SMTP id t3mr1652662itk.108.1557796864031; Mon, 13 May 2019 18:21:04 -0700 (PDT) In-Reply-To: <87a7fphqlz.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:159240 Archived-At: --000000000000b692500588ced8bd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 14, 2019 at 12:38 AM Noam Postavsky wrote: > > > 1. Does it fix the reported problem (assuming it is a problem, and not > > an otherwise potentially desirable change in behaviour)? > > It does fix the problem. > It reintroduces the previous behaviour, I gather. Can you explain quickly why it was "a problem"? > > 2. Do any of you have suspicions that it might introduce problems > > elsewhere? > > I'm unsure. It seems to be undoing a small part of [fd94312443] > 2019-01-22 "electric-layout-mode kicks in before electric-pair-mode", so > I guess it might rebreak whatever that commit is fixing. But I don't > quite understand what that commit is fixing (in particular, where the > commit message says "which can be a problem in some modes", which modes > are those? What is "a problem"?). > Sorry, can't say without investigating much more than time allows. Can you post the complete sentence? I vaguely remember that if electric-pair-mode kicked in before electric-layout-mode we would need more complex layout specs and more painful indentation logic. That's why I changed it. There is a thread of discussion with Stefan somewhere about this, not sure if public or off-list= . > > 3. Does it pass the automated test suite? > > No, it breaks 3 tests in tests/lisp/electric.el: > > 3 unexpected results: > FAILED electric-layout-int-main-kernel-style > FAILED electric-layout-plainer-c-mode-use-c-style > FAILED electric-modes-int-main-allman-style > > In each case, the reason for failure is that the expected result has > trailing whitespace that the actual result misses. I guess > electric-layout does want to put trailing whitespace in certain cases? > Yes, it certainly does. That trailing whitespace is indentation, I believe. And the cursor should be left at that indentation. Can you confirm? Anyway, if it's breaking tests it's almost certainly not what we want. And if it breaks in "plainer-c-mode" (a slightly better behaved c-mode), then its even more certain that it's not what we want. ... unless the tests are demading something unreasonable from the electric modes, of course. --=20 Jo=C3=A3o T=C3=A1vora --000000000000b692500588ced8bd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, May 14, 2019 at 12:38 AM Noam Pos= tavsky <npostavs@gmail.com>= wrote:

> 1. Does it fix the reported problem (assuming it is a problem, and not=
> an otherwise potentially desirable change in behaviour)?

It does fix the problem.

It reintroduce= s the previous behaviour, I gather. Can you explain
quickly = why it was "a problem"?
=C2=A0
> 2. Do any of you have suspicions that it might introduce problems
> elsewhere?

I'm unsure.=C2=A0 It seems to be undoing a small part of [fd94312443] 2019-01-22 "electric-layout-mode kicks in before electric-pair-mode&qu= ot;, so
I guess it might rebreak whatever that commit is fixing.=C2=A0 But I don= 9;t
quite understand what that commit is fixing (in particular, where the
commit message says "which can be a problem in some modes", which= modes
are those?=C2=A0 What is "a problem"?).

=
Sorry, can't say without investigating much more than time a= llows. Can you
post the complete sentence?

I vaguely remember that if electric-pair-mode kicked in before
electric-layout-mode we would need more complex layout specs and more=
painful indentation logic.=C2=A0 That's why I changed i= t.=C2=A0 There is a thread of
discussion with Stefan somewhe= re about this, not sure if public or off-list.
=C2=A0
> 3. Does it pass the automated test suite?

No, it breaks 3 tests in tests/lisp/electric.el:

3 unexpected results:
=C2=A0 =C2=A0FAILED=C2=A0 electric-layout-int-main-kernel-style
=C2=A0 =C2=A0FAILED=C2=A0 electric-layout-plainer-c-mode-use-c-style
=C2=A0 =C2=A0FAILED=C2=A0 electric-modes-int-main-allman-style

In each case, the reason for failure is that the expected result has
trailing whitespace that the actual result misses.=C2=A0 I guess
electric-layout does want to put trailing whitespace in certain cases?

Yes, it certainly does.=C2=A0 That t= railing whitespace is indentation, I believe. And
the cursor= should be left at that indentation.=C2=A0 Can you confirm? Anyway, if it&#= 39;s
breaking tests it's almost certainly not what we wa= nt.=C2=A0 And if it breaks in
"plainer-c-mode" (a sligh= tly better behaved c-mode), then its even more
certain that = it's not what we want.

... unless the tests ar= e demading something unreasonable from the electric
modes, o= f course.

--
Jo= =C3=A3o T=C3=A1vora
--000000000000b692500588ced8bd--