From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#42319: 28.0.50; c-mode issue with electric-pair-mode Date: Sat, 11 Jul 2020 15:15:12 +0200 Message-ID: <20200711131512.gur5wyzn5nlhibst@ergus> References: <20200711102653.35732.qmail@mail.muc.de> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27221"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: NeoMutt/20180716 Cc: 42319@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 11 15:16:15 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juFMU-0006zh-U4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Jul 2020 15:16:15 +0200 Original-Received: from localhost ([::1]:36556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1juFMU-0006l4-06 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 11 Jul 2020 09:16:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1juFMK-0006kv-AW for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2020 09:16:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1juFMH-000466-Sv for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2020 09:16:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1juFMH-0003gg-N2 for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2020 09:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Jul 2020 13:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42319 X-GNU-PR-Package: emacs Original-Received: via spool by 42319-submit@debbugs.gnu.org id=B42319.159447332714133 (code B ref 42319); Sat, 11 Jul 2020 13:16:01 +0000 Original-Received: (at 42319) by debbugs.gnu.org; 11 Jul 2020 13:15:27 +0000 Original-Received: from localhost ([127.0.0.1]:44018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juFLi-0003ft-Vq for submit@debbugs.gnu.org; Sat, 11 Jul 2020 09:15:27 -0400 Original-Received: from sonic310-13.consmr.mail.bf2.yahoo.com ([74.6.135.123]:36487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1juFLg-0003fd-Cj for 42319@debbugs.gnu.org; Sat, 11 Jul 2020 09:15:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1594473318; bh=i9TIU7xpvDXAweJU9eRSNR7+1m0Jl2AmalLz13Znxsk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=LzZQruh9LR/babYeSobMXJcZOIeYCP6Mem1lU69fiTextzyuACblGmKrFfeSHlkxWVNXT05sEswOEDK82y1RCxbkkgWgVxyv3Zl6+EI1qr110Ux/Jr1wjAIc6biqW+E3rKNXvaIOp4KpVSAA7OKDSFdSLHhAkm5vaPna9m8k5ClAL3ArNRX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onic310.consmr.mail.bf2.yahoo.com with HTTP; Sat, 11 Jul 2020 13:15:18 +0000 Original-Received: by smtp425.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 628154ee833070f22c6ef723e7696250; Sat, 11 Jul 2020 13:15:13 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20200711102653.35732.qmail@mail.muc.de> X-Mailer: WebService/1.1.16271 hermes_aol Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:182915 Archived-At: On Sat, Jul 11, 2020 at 10:26:53AM -0000, Alan Mackenzie wrote: >Hello, Ergus. > > >This happens because of the missing semicolon after the class. CC Mode >indents the otherwise empty line as a 'topmost-intro-cont line, I supposed so. >since it appears still to be within the class. But this is an issue right? because after that } it is already out of the class; ... even without the `;` there is not a class scope to indent right? The same applies to nested classes. Actually AFAIK without the `;` there is a syntax error if we insert anything else except for inline class/variable declarations like: class A { } var; or typedef class A { } type_A; But then the new line after the } should never be added? >One workaround for this is to >configure CC Mode not to insert a newline after this particular type of >brace. For example > >(push '(class-close before) c-hanging-braces-alist) > >, to try it out (it's a buffer local variable). > This works, thanks. I think that this should be the default as it is the most general/expected behavior and doesn't insert extra newline/spaces. This work around seems to be a cleaner solution than the cleanup ;p because it works easier for: ========= For: }; class A { }; # ========= And for: } var; class A { } var; # I think the user never wants this: ========== class A { } ; # ========= or ========= class A { } var; # And for sure not this: ========= class A { } var; # ========= But I am probably wrong. >> The problem is actually worst if defun-close-semi is in c-cleanup-list >> because it doesn't work. > >That surprises me. It works for me, here. What happens/fails to happen >in these circumstances? > Ohh, my bad. I forgot to add defun-close-semi when using -Q for reporting. So please forget it and forgive me. >> I need to remove the extra spaces first to make it work. > >That indeed feels like a bug. Could you perhaps post your CC Mode >configuration (generated by C-c C-b), please, which should help me to >reproduce the bug. > I discovered myself error with this... very useful. Thanks. So probably if you don't think that the extra indentation is an issue you can close this bug. Off-topic: I reported another issue (bug#42270) related with attributes and indentation. did you see it? Very Thanks, Ergus