From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie 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: Mon, 13 May 2019 10:14:48 +0000 Message-ID: <20190513101448.GA5525__30439.0206512593$1557742688$gmane$org@ACM> References: <87ftqms9db.fsf@secretsauce.net> <871s15k7ll.fsf@gmail.com> <20190511120524.GA15991@ACM> <87sgtlhyq5.fsf@gmail.com> <20190511161903.GB15991@ACM> <87lfzcwzs4.fsf@tcd.ie> <20190512161441.GD20053@ACM> <877eav5ouy.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="19134"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 35254@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 13 12:18:03 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 1hQ81z-0004sk-3j for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2019 12:18:03 +0200 Original-Received: from localhost ([127.0.0.1]:54561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQ81x-0008Dh-VG for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2019 06:18:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQ81p-0008Cj-E9 for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 06:17:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQ7z6-0005kJ-Fk for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 06:15:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58866) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQ7z4-0005jE-Nq; Mon, 13 May 2019 06:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQ7z4-00081w-EY; Mon, 13 May 2019 06:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 13 May 2019 10:15: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.155774249530838 (code B ref 35254); Mon, 13 May 2019 10:15:02 +0000 Original-Received: (at 35254) by debbugs.gnu.org; 13 May 2019 10:14:55 +0000 Original-Received: from localhost ([127.0.0.1]:44177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQ7yx-00081J-0o for submit@debbugs.gnu.org; Mon, 13 May 2019 06:14:55 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:57836 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hQ7yu-000816-Co for 35254@debbugs.gnu.org; Mon, 13 May 2019 06:14:53 -0400 Original-Received: (qmail 26911 invoked by uid 3782); 13 May 2019 10:14:49 -0000 Original-Received: from acm.muc.de (p4FE15EDF.dip0.t-ipconnect.de [79.225.94.223]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 13 May 2019 12:14:48 +0200 Original-Received: (qmail 5602 invoked by uid 1000); 13 May 2019 10:14:48 -0000 Content-Disposition: inline In-Reply-To: <877eav5ouy.fsf@tcd.ie> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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:159170 Archived-At: Hello, Basil. On Sun, May 12, 2019 at 22:45:09 +0100, Basil L. Contovounesios wrote: > Alan Mackenzie writes: > > On Sat, May 11, 2019 at 20:34:51 +0100, Basil L. Contovounesios wrote: > >> Sorry if my question is completely naive or irrelevant (I haven't read > >> the discussion very carefully), but how does the command > >> c-context-line-break, which is described under "Making the key > >> indent the new line" in (info "(ccmode) Getting Started") relate to this > >> issue, if at all? > > c-context-line-break doesn't really have much to say in the matter. The > > function is mainly about how to indent the _new_ line, and inserting > > various continuation markers. > > This bug is about trailing space in the _old_ line not getting removed > > on typing , about which c-context-line-break has nothing to say. > AFAICS c-context-line-break removes trailing space on the old line: > 0. emacs -Q > 1. C-x h C-w > 2. M-x c-mode RET > 3. int main() { > 4. RET RET > Line 2 now contains two trailing spaces. > 5. M-x c-context-line-break RET > Line 3 is now empty (has no trailing space). > Have I misunderstood something? Er, no. You're right, c-context-line-break does indeed remove the trailing WS, at least on normal code lines. Sorry about the mistake. But I don't think I've really understood how this observation fits in with the bug scenario. The bug is about the current master's default binding of (namely newline) not removing the trailing whitespace from the line it's typed in. I think you might be suggesting binding c-context-line-break to in CC Mode as a workaround for the problem; or possibly using its ideas to code up a CC Mode version of newline. I still think the bug should be fixed in the Emacs core, so that other modes which want the old line to have trailing spaces removed, yet don't use electric-indent-mode, will just work. > Thanks, > -- > Basil -- Alan Mackenzie (Nuremberg, Germany).