[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fixing post-self-insert-hook.
From: |
Alan Mackenzie |
Subject: |
Re: Fixing post-self-insert-hook. |
Date: |
Fri, 17 Sep 2021 20:35:50 +0000 |
Hello, João.
On Fri, Sep 17, 2021 at 21:15:33 +0100, João Távora wrote:
> Alan Mackenzie <acm@muc.de> 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).
Re: Fixing post-self-insert-hook., João Távora, 2021/09/17
- Re: Fixing post-self-insert-hook.,
Alan Mackenzie <=
Re: Fixing post-self-insert-hook., Eli Zaretskii, 2021/09/18