unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "João Távora" <joaotavora@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Fixing post-self-insert-hook.
Date: Fri, 17 Sep 2021 20:35:50 +0000	[thread overview]
Message-ID: <YUT8JrWJ+VbD7I4t@ACM> (raw)
In-Reply-To: <87k0jfdkm2.fsf@gmail.com>

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).



  reply	other threads:[~2021-09-17 20:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 19:37 Fixing post-self-insert-hook Alan Mackenzie
2021-09-17 20:04 ` Stefan Monnier
2021-09-17 20:53   ` Alan Mackenzie
2021-09-17 21:45     ` João Távora
2021-09-18  6:08       ` tomas
2021-09-18  8:44         ` João Távora
2021-09-18 14:15     ` Stefan Monnier
2021-09-18 15:56       ` Alan Mackenzie
2021-09-18 18:03         ` Stefan Monnier
     [not found]         ` <CALDnm52z_8HyqdC92nrMgzOMOOq48h2MQ4pjbROBOsdm5N_cJg@mail.gmail.com>
2021-09-18 22:55           ` João Távora
2021-09-19 12:14             ` Alan Mackenzie
2021-09-19 12:36               ` João Távora
2021-09-19 12:59               ` Stefan Monnier
2021-09-19 14:57                 ` Alan Mackenzie
2021-09-19 20:20                   ` Stefan Monnier
2021-09-17 20:15 ` João Távora
2021-09-17 20:35   ` Alan Mackenzie [this message]
2021-09-17 20:48     ` João Távora
2021-09-18  5:59     ` Eli Zaretskii
2021-09-18  9:41       ` Alan Mackenzie
2021-09-18  5:50 ` Eli Zaretskii
2021-09-18  9:57   ` Alan Mackenzie
2021-09-18 11:04     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YUT8JrWJ+VbD7I4t@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).