From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= 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 10:02:07 +0000 Message-ID: <87d0pt98ww.fsf@gmail.com> References: <20181221134829.29135.qmail@mail.muc.de> <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=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1545473293 12418 195.159.176.226 (22 Dec 2018 10:08:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Dec 2018 10:08:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Alan Mackenzie , bea@klebe.blog, 33794@debbugs.gnu.org, Stefan Monnier To: Beatrix Klebe Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 22 11:08: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 1gaeCV-00039M-66 for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 11:08:07 +0100 Original-Received: from localhost ([::1]:33815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaeEb-0004jO-FK for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 05:10:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gae7e-0007bz-KX for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 05:03:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gae7a-0001ba-UH for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 05:03:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54902) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gae7a-0001as-B8; Sat, 22 Dec 2018 05:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gae7Z-0006jH-Tp; Sat, 22 Dec 2018 05:03:01 -0500 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: Sat, 22 Dec 2018 10:03:01 +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.154547293725813 (code B ref 33794); Sat, 22 Dec 2018 10:03:01 +0000 Original-Received: (at 33794) by debbugs.gnu.org; 22 Dec 2018 10:02:17 +0000 Original-Received: from localhost ([127.0.0.1]:59160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gae6r-0006iH-IF for submit@debbugs.gnu.org; Sat, 22 Dec 2018 05:02:17 -0500 Original-Received: from mail-wm1-f50.google.com ([209.85.128.50]:33460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gae6q-0006i4-0t for 33794@debbugs.gnu.org; Sat, 22 Dec 2018 05:02:16 -0500 Original-Received: by mail-wm1-f50.google.com with SMTP id r24so15841196wmh.0 for <33794@debbugs.gnu.org>; Sat, 22 Dec 2018 02:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=7ybX+1PKDpt6oFQs3T/r64p4oN5MrECOs4avM7jwGMA=; b=idR+7BwbZcAAdfjIGBt5uzOn7DU+gahMnx6p36rpM+2+19y+RgTt+g9DHflBEDT/y+ k/QwiQiENMXi5/ZHjM/EfEkRXOwFe4hClWQYSBfOdOsO5as2OorJU1hN6sqllTfFj77z 8F9QyxsEEJh9ILyA3eLvjdPVCRY77I8/e2Pi6d/AwvIKX8iMXMalgRrH6cj3fdccpO6Y yItcKN7bE0CxIccAi0srUsWQLe8FwLN4bMgTjvEHwiHxqVwizuthPm2GsaqsoLsq3KQT o/zSVqDw8kgchXFHI0jPm56mCPyYcE7kjSpzl74xbM4zDz8Ydu5IixLP1bh4QNvpzdzm VOZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=7ybX+1PKDpt6oFQs3T/r64p4oN5MrECOs4avM7jwGMA=; b=CCo+ZoGLQqRi3oObitOSMF5HjJr66/Ka8qDt4+P9HBZ1JddmTr5NgZx7r01ODOl3DJ ZucQuEjntl9+nPGxirvu9R1KmcDDkLLamqoEGI5OJ7lbqmF/0WqQYhQurcYMfu+aM3E9 EqOiT8dph3lifeX7YTps9tl0WdbIlk0JAX7Bj3pj2tc1hGznnYNnwYqkr9azDph25pvu Z0I5aobcsLHkSmsab07nb0GvDGqWYbRg9K0zvMkJpM5ArZa4XiKUt9XDDZ1O3f5PDMii /NVn176qBlZytsokdHRQ76ULFxJRW80CPCwOWYyDCiHytmQBSq2Iq9F2+GfB6AU6sViT ZVLQ== X-Gm-Message-State: AA+aEWb1fVDGwNJiMR8TXFTc8kycZXflQFBCc2Mxe2MejfjfOXl65sc+ iCp5OpTzCQdLtb2b8HGIaQM= X-Google-Smtp-Source: AFSGD/VYb4Q7uQkWAe6anPNxXxQbcASsAkvfK4uvH9hLL92cN7y/wIRTGWhZyXNlDAgXwu1rcHToaw== X-Received: by 2002:a1c:1801:: with SMTP id 1mr6352948wmy.153.1545472930036; Sat, 22 Dec 2018 02:02:10 -0800 (PST) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id c9sm18737704wmh.27.2018.12.22.02.02.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Dec 2018 02:02:09 -0800 (PST) In-Reply-To: (Beatrix Klebe's message of "Fri, 21 Dec 2018 23:41:38 -0500") 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:153724 Archived-At: Beatrix Klebe writes: > I didn=E2=80=99t intend to kick the hornet=E2=80=99s nest of ideological = factions You kinda did, but it's in their nature to be kicked. > here, I was honestly just wondering if this was actually expected > behavior of these two modes together and if not if the fix was > trivial. The answer seems to be that it is indeed a bug and the fix is > non-trivial, All correct. > and furthermore while I appreciate attempts to hotfix it, those are > not solutions of the quality I was expecting Can you specify what is missing in terms of quality?=20 > , (I encountered those already while doing my own research before I > filed this bug report and I found them unsatisfactory both then and > now) and furthermore I feel like I should be open in stating that I > feel somewhat condescended to. I'm very sorry about that, it was never my intention (please read below). > I know what c-toggle-auto-newline is, I also know that functions > prefixed with =E2=80=9Ctoggle=E2=80=9D are functions that toggle a mode o= r setting > internally, in this case a minor mode called auto-newline > (https://www.gnu.org/software/emacs/manual/html_node/ccmode/Auto_002dnewl= ines.html) After following the link you gave me: I see the misunderstanding. You see, even though CC-mode's manual says "auto-newline" is a minor mode, it's not. It's just a variation on the major-mode's behaviour (in fact the CC-mode manual clarifies it here[1] as a "minor-mode-like feature", but the misunderstanding remained). There's no M-x auto-newline-mode to be invoked and no (define-minor-mode auto-newline-mode...) to be found in the code. Mentions to this as a minor mode are only found in the manual (a documentation bug, in my opinion). So this is why I was so specific with M-x c-toggle-auto-newline, becausen that's the actual command that someone who doesn't use it needs to turn on that pseudo-minor-mode: Without it, I couldn't observe the behaviour that you reported. With it, you couldn't experience the solution I was giving you. > I was about five minutes away from diving into the source of these two > packages to fix it myself, as I have spent probably 10 hours > reasearching this problem at this point. I=E2=80=99m sorry if I misunders= tood > something, I was mainly looking for clarification that what I was > experiencing was a bug, and it is beginning to seem like there is none > to be had here. OK I'll clarify: There is a bug: there are two diverging views on how to fix it because there are diverging views about where it lies in Emacs: * The only available fix so far (mine) is still experimental. I would appreciate your feedback but it's perfectly OK to go spend your time elsewhere because there's a risk that it won't make it in the end. In this fix, I'm not targetting Alan's code: I am extending an existing, separate feature that could render some of CC-mode's functionality, specifically the peudo auto-newline-mode, obsolete. * The other fix isn't available yet, in experimental or final form. Presumably it would target electric-pair-mode. If Alan, you, or someone else wants to work on it, that's quite alright, but beware that electric-pair-mode must work for all major modes (including things like minibuffers and REPLs), not just CC-mode. Regards, Jo=C3=A3o [1]: https://www.gnu.org/software/emacs/manual/html_node/ccmode/Minor-Modes= .html#Minor-Modes > > On Fri, Dec 21, 2018 at 10:22 PM Jo=C3=A3o T=C3=A1vora wrote: > > Alan Mackenzie writes: > > > Hello, Beatrix. > > > > As maintainer of CC Mode, I earnestly recommend you NOT to follow Jo= =C3=A3o's > > suggestion. It will not work, and will waste your time. > > What, exactly, will not 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? > > > 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 work= ed > > 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 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? > > I'm not asking you to nuke c-toggle-auto-newline or anything, 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 > :-)) > > 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. > > In the meantime let people explore alternatives, right? > > Jo=C3=A3o