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 12:33:28 +0000 Message-ID: <20181222123328.GB3935@ACM> References: <87tvj68j15.fsf@gmail.com> <87pntu8fx8.fsf@gmail.com> <20181222024143.GA3985@ACM> <87h8f68cu0.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 1545482352 18257 195.159.176.226 (22 Dec 2018 12:39:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Dec 2018 12:39:12 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Stefan Monnier , 33794@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 22 13:39:08 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 1gagYd-0004eK-21 for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 13:39:07 +0100 Original-Received: from localhost ([::1]:59038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gagaj-0001Pc-CM for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 07:41:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gagac-0001PU-HT for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 07:41:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gagaY-0001eW-Hg for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 07:41:10 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54965) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gagaU-0001ZG-Bo; Sat, 22 Dec 2018 07:41:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gagaU-00049Z-8L; Sat, 22 Dec 2018 07:41: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 12:41: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.154548241415901 (code B ref 33794); Sat, 22 Dec 2018 12:41:02 +0000 Original-Received: (at 33794) by debbugs.gnu.org; 22 Dec 2018 12:40:14 +0000 Original-Received: from localhost ([127.0.0.1]:59223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gagZh-00048O-A6 for submit@debbugs.gnu.org; Sat, 22 Dec 2018 07:40:13 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:62798 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gagZf-00048F-B7 for 33794@debbugs.gnu.org; Sat, 22 Dec 2018 07:40:12 -0500 Original-Received: (qmail 65487 invoked by uid 3782); 22 Dec 2018 12:40:10 -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 13:40:09 +0100 Original-Received: (qmail 6963 invoked by uid 1000); 22 Dec 2018 12:33:28 -0000 Content-Disposition: inline In-Reply-To: <87h8f68cu0.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:153734 Archived-At: Hello, Joćo. On Sat, Dec 22, 2018 at 03:22:47 +0000, Joćo Tįvora wrote: > Alan Mackenzie writes: > > Hello, Beatrix. > > As maintainer of CC Mode, I earnestly recommend you NOT to follow Joćo's > > suggestion. It will not work, and will waste your time. > What, exactly, will not work? Can't say exactly, but a quick hack on some minor mode which violates and attempts to duplicate the conventions of the major mode, not intensively tested, is not going to work. > > Even if it appears to work, you will end up picking out bugs for an > > indeterminate period. > What bugs? If you know of any, it would be good to report them, right? See above. > > Basically, electric-pair-mode as it is currently built is incompatible > > with CC Mode, as I have pointed out here, albeit somewhat > > undiplomatically. > > I suggest you do nothing until tempers amongst Emacs developers have > > cooled down, and hopefully a genuine solution to the bug has been worked > > out and implemented. > If you don't like electric-layout-mode, don't use it. I'm trying to > develop an alternative to c-toggle-auto-newline .... Which is the wrong thing to do. > .... within the electric-*-mode frame. It's an experiment which I > don't even know if Stefan will agree to, but it seems to work. If > Beatrix wants to cooperate, why shouldn't she? My reading of the situation is that Beatrix reported a bug, expecting/hoping for it to be fixed, so that she can get on with her work more effectively. I don't think she wants to spend lots of time debugging (which is our job). > I'm not asking you to nuke c-toggle-auto-newline or anything, .... It looks rather that we to me, I must say. > .... but should we all be forced to use it? I don't think it's > sensible in a free software project, Alan (and my temper is quite cool > when saying this :-)) Eh?? The auto-newline facility is there and is optional. It is an integral part of CC Mode. Where is this "forcing" you're referring to? I think the situation is that the various electric-... facilities can only work with major modes designed in a particular restricted fashion - they are not universal. Your answer is to try and impose these restrictions on all major modes. That can't work, since we don't control all such modes, and imposing restrictions is a Bad Thing generally. > Again, I said I don't have anything against making eletric-pair-mode > compatible with c-toggle-auto-newline if someone comes up with a good > solution that doesn't break e-p-m for other modes. I will not invest > time in looking into that solution, but you or someone else may, of > course. As I've said elsewhere, the key to the fix is fixing the breakage of self-insert-command. That is going to involve extensive changes to electric-pair-mode, but will fix the problem rather than trying to work around it. My idea at the moment is to change from using post-self-insert-hook to using post-command-hook, thus fixing self-insert-command. There should also be a buffer local variable holding the function to insert the matching paren with, defaulting to self-insert-command, or similar. Would this work, and if not, where would it fail? Is there any documentation for the connections between electric-pair-mode and the other electric-... facilities? As I've also said elsewhere, the fundamental root of the current problem is social: somebody inventing facilities which impose constraints on Emacs in general, and imposing these on Emacs without public discussion. That cannot end well, and it hasn't ended well. > In the meantime let people explore alternatives, right? It does not lie within my power to stop them. ;-) > Joćo -- Alan Mackenzie (Nuremberg, Germany).