From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#33794: 26.1; electric-pair-mode breaks auto-newline minor mode of cc-mode Date: Sat, 22 Dec 2018 22:15:40 +0000 Message-ID: <20181222221540.GC3935@ACM> References: <20181221134829.29135.qmail@mail.muc.de> <20181221215042.GC16032@ACM> <87woo16yzp.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1545517275 10369 195.159.176.226 (22 Dec 2018 22:21:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Dec 2018 22:21:15 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: bea@klebe.blog, Stefan Monnier , 33794@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , Beatrix Klebe Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 22 23:21:10 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gapdq-0002UU-Vz for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 23:21:07 +0100 Original-Received: from localhost ([::1]:36669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gapfx-0008JD-Lx for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 17:23:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gapfo-0008J7-51 for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 17:23:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gapfn-0004Cq-5w for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 17:23:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56025) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gapfi-00040s-H2; Sat, 22 Dec 2018 17:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gapfi-0005fR-8u; Sat, 22 Dec 2018 17:23:02 -0500 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: Sat, 22 Dec 2018 22:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33794 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 33794-submit@debbugs.gnu.org id=B33794.154551734821728 (code B ref 33794); Sat, 22 Dec 2018 22:23:02 +0000 Original-Received: (at 33794) by debbugs.gnu.org; 22 Dec 2018 22:22:28 +0000 Original-Received: from localhost ([127.0.0.1]:60283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gapfA-0005eO-Hi for submit@debbugs.gnu.org; Sat, 22 Dec 2018 17:22:28 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:10419 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gapf8-0005eF-Jb for 33794@debbugs.gnu.org; Sat, 22 Dec 2018 17:22:27 -0500 Original-Received: (qmail 94406 invoked by uid 3782); 22 Dec 2018 22:22:24 -0000 Original-Received: from acm.muc.de (p2E5D5238.dip0.t-ipconnect.de [46.93.82.56]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 22 Dec 2018 23:22:22 +0100 Original-Received: (qmail 9930 invoked by uid 1000); 22 Dec 2018 22:15:40 -0000 Content-Disposition: inline In-Reply-To: <87woo16yzp.fsf@gmail.com> 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: 208.118.235.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:153758 Archived-At: Hello, Beatrix and Joćo. On Sat, Dec 22, 2018 at 21:19:22 +0000, Joćo Tįvora wrote: > Beatrix Klebe writes: > > Well, in that case, I am flattered that my opinion is given much > > weight in this. > It's supposed to work like that everyday in the Emacs bug tracker. If > it flatters you, so much the better :-) > > Things such as c-toggle-auto-newline, for example, almost seem in this > > case that they might be better delegated to electric-layout-mode, with > > cc-mode specifying different electric-layout constraints for its > > different formatting styles. It seems this is close to what Joćo was > > suggesting? This is what I oppose. Given how well CC Mode's auto-newline works, such a change would almost certainly be a negative step in quality, portability, and would be a lot of unrewarding work to do. CC Mode isn't broken, here. It doesn't need fixing, here. > Yes, that is precisely what I am suggesting. I am happy that this point > made it across. > Though there is not any need to give up on c-toggle-auto-newline if you > don't use electric-pair-mode, or if you use some other tool like > smartparens, or perhaps even my older tool autopair.el (tho those tools > might have other drawbacks that I don't known) If electric-pair-mode was fixed, it would work perfectly well with CC Mode. > > And I suspect what Alan disagrees with? I apologize for any > > misunderstanding. One of the things, yes. CC Mode has, for years, been under constant attack from people who want to make Emacs major modes work only the way they think modes should. CC Mode works differently, for good reasons. To adapt CC Mode the way these people want would have significant disadvantages, including some lost functionality. Right now, Joćo's direction of travel seems to be to cement electric-pair-mode's unusability in modes like CC Mode, of which there are quite a few. I hope I've misunderstood this and I'm mistaken. > Yes, Alan disagrees with this. In his view, electric- modes are abusing > the semantics of post-self-insert-hook. Well, at least in my view of > his views :-) Please don't misrepresent me like that. The point is that the electric-... modes abuse not so much the post-self-insert-hook (although they do), but they totally break self-insert-command. You have had several hours to contest this, but by your silence appear to have accepted it. electric-pair-mode breaks self-insert-command. self-insert-command is (or was) a general purpose command for inserting typed characters into a buffer. With electric-pair-mode enabled, it ceases to be general purpose, being usable only in contexts blessed by the electric-... functionality. This is why CC Mode's auto-newline broke. It will stay broken until electric-pair-mode's breaking of that function gets fixed. > Joćo [ .... ] -- Alan Mackenzie (Nuremberg, Germany).