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 13:47:31 +0000 Message-ID: <874lb58yh8.fsf@gmail.com> References: <20181221134829.29135.qmail@mail.muc.de> <20181221201106.GB16032@ACM> <87y38iqti7.fsf@gmail.com> <20181222102011.GA3935@ACM> 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 1545486370 25632 195.159.176.226 (22 Dec 2018 13:46:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Dec 2018 13:46:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: bea@klebe.blog, Stefan Monnier , 33794@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 22 14:46:05 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 1gahbO-0006XT-TF for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 14:46:03 +0100 Original-Received: from localhost ([::1]:35488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gahdV-00036W-Gr for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 08:48:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gahdN-00035A-6y for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 08:48:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gahdK-0008GH-1e for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 08:48:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gahdJ-0008G2-U1; Sat, 22 Dec 2018 08:48:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gahdJ-0005gq-LJ; Sat, 22 Dec 2018 08:48: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 13:48: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.154548646321849 (code B ref 33794); Sat, 22 Dec 2018 13:48:01 +0000 Original-Received: (at 33794) by debbugs.gnu.org; 22 Dec 2018 13:47:43 +0000 Original-Received: from localhost ([127.0.0.1]:59234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gahd1-0005gL-By for submit@debbugs.gnu.org; Sat, 22 Dec 2018 08:47:43 -0500 Original-Received: from mail-wm1-f43.google.com ([209.85.128.43]:52308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gahcz-0005g9-GV for 33794@debbugs.gnu.org; Sat, 22 Dec 2018 08:47:42 -0500 Original-Received: by mail-wm1-f43.google.com with SMTP id m1so7727287wml.2 for <33794@debbugs.gnu.org>; Sat, 22 Dec 2018 05:47:41 -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=DUisMer9zfzlETUtMKOPZ4tiFsXHYRM6yKtzdpzqLt0=; b=H66oBGSXiAg5UYZS8SxzlSPJORUkCK3tAJoZMMbx4r8sHzzDfB6XHvTveH+2CN9ivZ 04PcKWp5aY36sELdyFKyxHol0zCsPvjqy+2wlbfK3XiLs+XaC7nX3QTobOSHV6OeE73K EQWQ3NrFsA7qyVeXE1x6nNkxLe6m/NWpVZFhcjIj5NwwpgKPoz0qIg/uv8N6wlJ8Q11o 0T7cI7T3HYEOIsHOWKcPt5+4pPbqKfXHctanxh32pJkfdDLZgwhutV7XkDonDQBOC3Gb iZfZpD107HJBjEjU+L1tVN5Gxct2OF3AL3jZiQsa4hvqyN8E5TSljDs5XL0u0P4edo+B BEEA== 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=DUisMer9zfzlETUtMKOPZ4tiFsXHYRM6yKtzdpzqLt0=; b=Po3BcSlau3GSJpO6hOHQ/y+O5Y3Q227o2F0qMEVpSC+KMgQrGAS7Hn0hNav5lBFZsT IwEGAIsOPI5T9avLYhuWvu0KGCtUPWKTMNqN6NUDXd4yARUWESuyWI0nxObbQFqsr0xZ SvstyRnMioL+B8eJnQO+EKrE1eje9UZfkiLsssBqR8WTmlG4EcMGVxf8qdD2WShqTQat gJmnJVShL/0qkoJIsoQndzChpeae0Du+NeWt+dIraEItRtGu+aZSnpKxDigbd+Kuj94j 36Ez6jod6Xdmdg7uiIOtVV1z4Z+y1Yc+LZrL0jRjHWBqfZxI8O54AUvCT6YDxnHhYw+w ff/g== X-Gm-Message-State: AJcUukdz+A5WfYToJhKxFvbb3L89MTKP7Slxhmd0/wlVFKZD6/BOYzXV CXJ1sSOGNv1T2cWJZI2LwwLCeKPy X-Google-Smtp-Source: AFSGD/WF+zlrjPnA/xKyB7TU2ay+qcIkxm+jEpAkXeqdqHWU7uLQK/7bCgZuGGsnJN/bWuvcZF9MtQ== X-Received: by 2002:a1c:ad45:: with SMTP id w66mr6432051wme.60.1545486455279; Sat, 22 Dec 2018 05:47:35 -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 y138sm18901656wmc.16.2018.12.22.05.47.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Dec 2018 05:47:34 -0800 (PST) In-Reply-To: <20181222102011.GA3935@ACM> (Alan Mackenzie's message of "Sat, 22 Dec 2018 10:20:11 +0000") 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:153735 Archived-At: Hello Alan, I will be, again, responding to your two emails in one. Alan Mackenzie writes: > This clearly isn't true at the moment. Have you tested it with, for > example, Cperl Mode, or Vera Mode? That characteristic is an > aspiration, which is laudable. Fair enough. But what are the bugs in those modes? I've just tested it briefly there and it seems to work. I type parenthesis of various kinds and they get autopaired and autoskipped. > I think that what is missing from this history is the stage where the > idea with proposed solution is first discussed on emacs-devel, where > conceptual problems can be identified and resolved. As a result, e-p-m > is only compatible with some major modes; it is incompatible with those > that explicitly call self-insert-function as part of a command bound to > a key which is usually self-inserting. There are quite a few such > modes. I think, but I'm not sure, that anycommand that eventually calls post-self-insert-hook would also work. > The answer is, of course, that "{" should be inserted into the buffer. > With electric-pair-mode-enabled, what actually happens is that "{}" > gets inserted instead. This is broken. I ask you to consider this > paragraph very carefully rather than reacting emotionally against it. Alan, OK, that is your opinion, but please don't tell me which part of my brain to use when reacting to something, that's a wee bit too arrogant... > Again, you're much more familiar with electric-indent-mode, and friends. > Do they also break self-insert-command? No idea. And I'm not very familiar with them, no. Look, the framework for inserting extra things in post-self-insert-hook was already in place when I joined the party. Be it space for indent or newlines for layout or delimiters for pairing. I just followed those tracks, which apparently cause you dismay. And I enjoyed it, hehehe, sorry :-) it really did make coding easier. > with a few quick hacks can only lead to frustration all round, and to > tears. My tears, certainly, because I'm such an emotional trainwreck :-) > self-insert-command needs to behave correctly, according to its > documentation. It is surely not beyond us to fix these problems. Of course there are different ways to solve problems. I think the way I am exploring is the best. You think otherwise, that's OK. > 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. Who convened where to decide this that you call "convention"? And exactly what conventions is electric-layout-mode breaking (btw, you should be aware that electric-layout-mode exists since 2010: Again, long before I joined the party). >> What bugs? If you know of any, it would be good to report them, right? > See above. I did, but I don't see any reports of flawed behaviour there. I'm not saying there aren't any bugs: I'm just saying you should first look to indications or traces of these bugs before publically stating that there are. > Which is the wrong thing to do. Did you see The Big Lebowsky by the Cohen brothers? :-) There's a nice riposte there, apropos opinions. > I don't think she wants to spend lots of time debugging (which is our > job). Yes, maybe. It's up to her, of course. But it's not my "job", it's something I do for fun. And Alan, I have some experience in dealing with user's reports too (neatly over a decade long, since that seems to matter to you) and some users are more cooperative than others, and that's fine. > 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? Fair enough, no "forcing". It sounded like you were suggesting to Beatrix that she stay away from any solution except yours, for no reason other than your authority as CC-mode maintainer and some unsubstantiated prophecies of disaster. > Is there any documentation for the connections between > electric-pair-mode and the other electric-... facilities? I don't think so: unless you count comments. The interfaces they adhere to to work together is post-self-insert-hook, with a few hacks here and there marked FIXME by Stefan. > 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. There's something here that doesn't make sense: you repudiate "constraints", but you laud "convention". But, in my view, pieces of software uses "interfaces" to work together. We're just discussing here who violated them, that's all. Jo=C3=A3o PS: Without public discussion??? This discussion _is_ public! :-)