From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Fixing post-self-insert-hook. Date: Fri, 17 Sep 2021 20:35:50 +0000 Message-ID: References: <87k0jfdkm2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29018"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?Jo=E3o_T=E1vora?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 17 22:36:48 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRKbH-0007Mb-Dh for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Sep 2021 22:36:47 +0200 Original-Received: from localhost ([::1]:34046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRKbF-0003SN-Lz for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Sep 2021 16:36:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRKaR-0002he-Db for emacs-devel@gnu.org; Fri, 17 Sep 2021 16:35:55 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:61017 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1mRKaP-0004gX-7U for emacs-devel@gnu.org; Fri, 17 Sep 2021 16:35:55 -0400 Original-Received: (qmail 66864 invoked by uid 3782); 17 Sep 2021 20:35:50 -0000 Original-Received: from acm.muc.de (p4fe159e7.dip0.t-ipconnect.de [79.225.89.231]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 17 Sep 2021 22:35:50 +0200 Original-Received: (qmail 8834 invoked by uid 1000); 17 Sep 2021 20:35:50 -0000 Content-Disposition: inline In-Reply-To: <87k0jfdkm2.fsf@gmail.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:274938 Archived-At: Hello, Joćo. On Fri, Sep 17, 2021 at 21:15:33 +0100, Joćo Tįvora wrote: > Alan Mackenzie writes: > > What isn't fine is when self-insert-function is called from Lisp, as it > > is 293 times from our sources, including from cc-cmds.el. The calling > [...] > > Instead of getting called straight after the self-insert-command, it > > should be called at the end of the command which called > > self-insert-command. Just before post-command-hook, perhaps. Yes there > > are details to be worked out. > Let me get this straight: are you are proposing that 283 + > who-knows-how-many third-party references to 'self-insert-command' -- > which all have been working fine as far as we know -- should _change_ to > accomodate the 10 problematic calls that are found in cc-cmds.el? Actually, I miscounted, sorry, it's 111 calls to self-insert-command. But that's still a lot. The point is, these calls are currently undefined. Pretty much every last one of them, apart from the ones in cc-cmds.el, which have been made defined again. These 111 calls might have been working, they might not, they might have sort of been working as long as electric-pair-mode isn't enabled. Who knows? They're currently in a sort of race condition. But most of these calls, I guess, were there long before post-self-insert-hook, and they were working then. They would work again if the call to p-s-i-h was delayed. So, yes, you're basically right. We should move the call to p-s-i-h not just to fix the interface to electric-pair-mode and friends, but to bring sanity back to Emacs with respect to this matter. You have recently said you don't want to change the mechanism of the electric-... functionality. This is one way to fix it without you having to make any such changes. Can you see any concrete problems with making this change? > Best regards, > Joćo -- Alan Mackenzie (Nuremberg, Germany).