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: Sun, 23 Dec 2018 20:21:43 +0000 Message-ID: <20181223202143.GA6658__24271.0002385595$1545600388$gmane$org@ACM> References: <20181221134829.29135.qmail@mail.muc.de> <20181221215042.GC16032@ACM> <87woo16yzp.fsf@gmail.com> <20181222221540.GC3935@ACM> <87sgypmasb.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 1545600388 9218 195.159.176.226 (23 Dec 2018 21:26:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 23 Dec 2018 21:26:28 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Beatrix Klebe , bea@klebe.blog, 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 Sun Dec 23 22:26:23 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 1gbBGQ-0002Iv-RZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Dec 2018 22:26:23 +0100 Original-Received: from localhost ([127.0.0.1]:42056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbAN8-0001xG-RJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Dec 2018 15:29:14 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbAN0-0001vW-Gp for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2018 15:29:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbAMw-0008ND-Lu for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2018 15:29:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58037) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gbAMw-0008N3-Ga; Sun, 23 Dec 2018 15:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gbAMw-0002qN-70; Sun, 23 Dec 2018 15:29: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: Sun, 23 Dec 2018 20:29: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.154559691910895 (code B ref 33794); Sun, 23 Dec 2018 20:29:02 +0000 Original-Received: (at 33794) by debbugs.gnu.org; 23 Dec 2018 20:28:39 +0000 Original-Received: from localhost ([127.0.0.1]:34062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gbAMY-0002pe-Ld for submit@debbugs.gnu.org; Sun, 23 Dec 2018 15:28:38 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:26177 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gbAMW-0002pU-JC for 33794@debbugs.gnu.org; Sun, 23 Dec 2018 15:28:37 -0500 Original-Received: (qmail 13008 invoked by uid 3782); 23 Dec 2018 20:28:35 -0000 Original-Received: from acm.muc.de (p2E5D5BBB.dip0.t-ipconnect.de [46.93.91.187]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 23 Dec 2018 21:28:34 +0100 Original-Received: (qmail 8453 invoked by uid 1000); 23 Dec 2018 20:21:43 -0000 Content-Disposition: inline In-Reply-To: <87sgypmasb.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:153806 Archived-At: Hello, Joćo. On Sat, Dec 22, 2018 at 22:55:32 +0000, Joćo Tįvora wrote: > Alan Mackenzie writes: > > 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. > You are. In fact, I'm coming up with alternatives so that > electric-pair-mode works with CC-Mode, even if the user or some other > mode customizes it to not use c-electric-{brace,paren}. CC Mode is not customisable in this way, any more than any other major mode. Ripping out and replacing the innards of Lisp code is called "hacking", not "customisation". At the moment, electric-pair-mode does not work with c-electric-brace and c-electric-paren. This is the bug reported by Beatrix, the OP. You are telling me you are not working on fixing the part of this problem which is in e-p-m. Please understand me being somewhat frustrated by this. If I were to dig in to e-p-m, make fixes, and commit them, I suspect you would be somewhat annoyed. > You may say that I am not working actively to make e-p-m work with > c-toggle-auto-newline, which *in my opinion* is a part of CC-mode that > could and should someday be fulfilled by electric-layout-mode. I think you really mean c-electric-{brace,paren} here, not c-toggle-auto-newline. electric-layout-mode won't be superseding those functions any time soon. > That is 100% true. But I am not preventing anyone from taking on that > task, or even suggesting it's trivial or very hard. I just don't > know, and I have no interest in studying this alternative. But you're posting in the thread for bug #33794. I'm disappointed you're not cooperating with me to fix this bug. > That is quite different from "cementing an unusability".Have a look at > my recent commits in scratch/fix-33794-extend-electric-layout-mode and > you will see that I have done 0 changes to e-p-m. I'm not interested in that branch, I'm afraid. electric-layout-mode has no relevance to CC Mode. I'm more interested in bug #33794. > Also, can you once and for all describe the "unusabilities" in other > modes you keep talking about??? Yes. These other modes call self-insert-command. self-insert-command, because of the way post-self-insert-hook is (ab)used, has no definite function. Sometimes it does what the doc says (inserting N copies of the last character typed), other times it does other things. The only safe way for a mode to call self-insert-command is by binding post-self-insert-hook to a known value, usually nil. This prevents all electric-pair-mode processing. I would very much like c-electric-brace, etc., to be able to use e-p-m functionality, rather than partially duplicating it inside cc-cmds.el, as I did in the patch I sent to Beatrix, Cc: to yourself, earlier on today. > >> 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. > Really, I didn't. But OK, I will think thrice before writing "Alan > thinks" sentences. Sorry, you didn't really, that's true. But you did put the emphasis on the wrong point. > > The point is that the electric-... modes abuse not so much the > > post-self-insert-hook (although they do), > So, in reality I didn't misrepresent you. > > but they totally break self-insert-command. You have had several > > hours to contest this, but by your silence appear to have accepted it. > How can I contest or accept that which I have no opinion of? I'm not an > expert in the teleology of self-insert-command! Find someone who is to > discuss this! You're working on #33794. You must surely have some notion of the cause of the bug. I've said what my idea is, and I'm somewhat disappointed you've failed to comment on this central point. Without understanding the cause of a bug, any fix is going to be suboptimal. > Frankly: "my silence"... I'm not taking that bait, OK? Really, Alan, > please please understand that I am only trying to make > electric-layout-mode work a bit better, and not even touching any of its > basic functioning vis-a-vis self-insert-command. But you're commenting on this thread, which is about a bug concerning the interaction of e-p-m with CC Mode, not e-l-m. > Joćo -- Alan Mackenzie (Nuremberg, Germany).