From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38406: 27.0.50; post-self-insert-hook does not hold its contract in cc-mode derived modes Date: Fri, 06 Dec 2019 10:06:31 +0200 Message-ID: <83eexhho8o.fsf@gnu.org> References: <20191130143638.GA6716@ACM> <20191201150738.GB5085@ACM> <83imn0lyed.fsf@gnu.org> <20191201192709.GE5085@ACM> <83blsrn58a.fsf@gnu.org> <20191204204159.GA7587@ACM> <83immuj0g7.fsf@gnu.org> <20191205190951.GA6252@ACM> <83pnh2h8x1.fsf@gnu.org> <20191205201713.GC6252@ACM> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="240461"; mail-complaints-to="usenet@blaine.gmane.org" Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 06 18:26:58 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1idHNa-0010Ek-6b for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2019 18:26:58 +0100 Original-Received: from localhost ([::1]:41882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idHNY-0000mX-Mk for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2019 12:26:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51828) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idGK6-00061T-IM for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:19:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idGK1-0003F9-Rb for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:19:18 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40972) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1idGK1-000358-Ji for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:19:13 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1idGGx-00054F-1j for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:16:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Dec 2019 16:16:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38406 X-GNU-PR-Package: emacs Original-Received: via spool by 38406-submit@debbugs.gnu.org id=B38406.157564894619398 (code B ref 38406); Fri, 06 Dec 2019 16:16:03 +0000 Original-Received: (at 38406) by debbugs.gnu.org; 6 Dec 2019 16:15:46 +0000 Original-Received: from localhost ([127.0.0.1]:46931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idGGf-00052f-Fk for submit@debbugs.gnu.org; Fri, 06 Dec 2019 11:15:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idGGa-00050w-28 for 38406@debbugs.gnu.org; Fri, 06 Dec 2019 11:15:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1idGGN-00089o-BZ; Fri, 06 Dec 2019 11:15:27 -0500 Original-Received: from [176.228.60.248] (port=2068 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1id8dD-0003Be-E3; Fri, 06 Dec 2019 03:06:32 -0500 In-reply-to: <20191205201713.GC6252@ACM> (message from Alan Mackenzie on Thu, 5 Dec 2019 20:17:13 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 209.51.188.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:172957 Archived-At: > Date: Thu, 5 Dec 2019 20:17:13 +0000 > Cc: yyoncho@gmail.com, 38406@debbugs.gnu.org > From: Alan Mackenzie > > > We never provide any "safety nets" for silly hook functions, so we > > shouldn't do that here as well. OTOH, if someone puts a function on > > those hooks which does something legitimate, we should meet their > > expectations and let those functions run, as the contract says. > > I think that, with my latest patch, that is the case. > > > So I think you shouldn't filter anything from the hook before you run > > it. > > I thought you were urging me to do precisely that two or three posts ago. > > I just tried taking a particular function off of > c--unsafe-post-self-insert-hook-functions and enabling electric-pair > mode. On typing a brace, electric-pair-mode threw an obscure error. It > doesn't make sense to call electric-pair-post-self-insert-function twice > for one keypress. That is a good reason for having that function > filtered out of the hook. There might be a misunderstanding on my part here. Could you please explain how come electric-pair-post-self-insert-function is called twice if it isn't removed from the hook? where's the second (or the first) call? > The root of the problem is the hook post-self-insert-hook. It is a > thoroughly bad idea. The implications of introducing it a few years ago > weren't thought through. That might be so, but I think it's too late for removing it now. > Assuming that removing this hook from Emacs isn't an option, we are > left with ugly ad-hoc workarounds, such as the patch we're currently > discussing. Yes.