Subject: Re: insert-file-contents can corrupt buffers. [Was: bug#50946: Emacs-28: Inadequate coding in hack-elisp-shorthands]

From: João Távora <[email-masked]>
Date: Sun, 3 Oct 2021 20:59:55 +0100

On Sun, Oct 3, 2021 at 8:51 PM Eli Zaretskii <[email-masked]> wrote:

> > Given you dislike hooks, the patch with
> > hack-read-symbol-shorthands-function is below.  Looks good?
>
> I like it slightly less than my proposal, because it spreads the
> arrangement over 3 files instead of just 2.

No, you're not counting right, or I'm not. I count only 2 in my arrangement.

In my arrangement, loadup.el knows nothing about the agreement
between mule.el and shorthands.el. So it's the same, but without the
negative "inhibit" logic and mule.el knowing about a function in files.el,
which is loaded after it.

It's shorthands.el who knows about two things loaded before it: a variable
and a function, as it The Right Thing.  Which reminds me, shorthand.el
should (require 'mule)

>  But if you want a hook so badly, I won't fight.

I don't want it badly, I just think it's simpler and easier to reason about.
The version I propose uses a "-function" variable instead of a hook.

> Just put a comment in mule.el describing how we arrange for this to start
> being in effect.

I have, already.

João